Skip to content

Commit 87a6c95

Browse files
committed
bug fixed
1 parent 40a327d commit 87a6c95

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

streamlit/home.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,30 @@
88
from scipy.stats import norm
99
from scipy import stats
1010
import random
11-
import functions as ff
12-
import main_analysis as main
13-
import os
1411

1512
#######################################
1613
# DATA LOADING
1714
#######################################
1815

1916
st.set_page_config(layout='wide')
2017

21-
# Determine the base path
22-
base_path = os.path.dirname(__file__)
23-
24-
# Loading data files
25-
df = pd.read_csv(os.path.join(base_path, 'df2020.csv'))
26-
df2018 = pd.read_csv(os.path.join(base_path, 'df2018.csv'))
27-
full_data2018 = pd.read_csv(os.path.join(base_path, 'survey_results_sample_2018.csv'))
28-
full_data2019 = pd.read_csv(os.path.join(base_path, 'survey_results_sample_2019.csv'))
29-
full_df2020 = pd.read_csv(os.path.join(base_path, 'survey_results_sample_2020.csv'))
30-
df2019 = pd.read_csv(os.path.join(base_path, 'df2019.csv'))
18+
# Loading data files from the 'streamlit' directory
19+
df = pd.read_csv('streamlit/df2020.csv')
20+
df2018 = pd.read_csv('streamlit/df2018.csv')
21+
full_data2018 = pd.read_csv('streamlit/survey_results_sample_2018.csv')
22+
full_data2019 = pd.read_csv('streamlit/survey_results_sample_2019.csv')
23+
full_df2020 = pd.read_csv('streamlit/survey_results_sample_2020.csv')
24+
df2019 = pd.read_csv('streamlit/df2019.csv')
3125

3226
# Filter the 2020 dataframe
3327
df2020 = df[df['SalaryUSD'] < 200000]
3428

3529
# Load CSS file
3630
def local_css(file_name):
37-
css_path = os.path.join(base_path, file_name)
38-
with open(css_path) as f:
31+
with open(file_name) as f:
3932
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
4033

41-
local_css("style.css")
34+
local_css("streamlit/style.css")
4235

4336
#######################################
4437
# DATA PREPARATION FOR VISUALISATION

0 commit comments

Comments
 (0)