|
8 | 8 | from scipy.stats import norm
|
9 | 9 | from scipy import stats
|
10 | 10 | import random
|
11 |
| -import functions as ff |
12 |
| -import main_analysis as main |
13 |
| -import os |
14 | 11 |
|
15 | 12 | #######################################
|
16 | 13 | # DATA LOADING
|
17 | 14 | #######################################
|
18 | 15 |
|
19 | 16 | st.set_page_config(layout='wide')
|
20 | 17 |
|
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') |
31 | 25 |
|
32 | 26 | # Filter the 2020 dataframe
|
33 | 27 | df2020 = df[df['SalaryUSD'] < 200000]
|
34 | 28 |
|
35 | 29 | # Load CSS file
|
36 | 30 | 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: |
39 | 32 | st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
|
40 | 33 |
|
41 |
| -local_css("style.css") |
| 34 | +local_css("streamlit/style.css") |
42 | 35 |
|
43 | 36 | #######################################
|
44 | 37 | # DATA PREPARATION FOR VISUALISATION
|
|
0 commit comments