10
10
import random
11
11
import functions as ff
12
12
import main_analysis as main
13
- import os
13
+
14
14
15
15
#######################################
16
16
# DATA LOADING
17
17
#######################################
18
18
19
19
st .set_page_config (layout = 'wide' )
20
20
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' ))
21
+ # Loading data files from the 'streamlit' directory
22
+ df = pd .read_csv ('streamlit/df2020.csv' )
23
+ df2018 = pd .read_csv ('streamlit/df2018.csv' )
24
+ full_data2018 = pd .read_csv ('streamlit/survey_results_sample_2018.csv' )
25
+ full_data2019 = pd .read_csv ('streamlit/survey_results_sample_2019.csv' )
26
+ full_df2020 = pd .read_csv ('streamlit/survey_results_sample_2020.csv' )
27
+ df2019 = pd .read_csv ('streamlit/df2019.csv' )
31
28
32
29
# Filter the 2020 dataframe
33
30
df2020 = df [df ['SalaryUSD' ] < 200000 ]
34
31
35
32
# Load CSS file
36
33
def local_css (file_name ):
37
- css_path = os .path .join (base_path , file_name )
38
- with open (css_path ) as f :
34
+ with open (file_name ) as f :
39
35
st .markdown (f'<style>{ f .read ()} </style>' , unsafe_allow_html = True )
40
36
41
- local_css ("style.css" )
37
+ local_css ("streamlit/ style.css" )
42
38
43
39
#######################################
44
40
# DATA PREPARATION FOR VISUALISATION
@@ -203,3 +199,4 @@ def plot_value_counts(column_name):
203
199
</div>
204
200
"""
205
201
st .markdown (highest_paying_ds_text , unsafe_allow_html = True )
202
+
0 commit comments