From 87a6c9574e76aad2ada9309e47327e08ac45aa3b Mon Sep 17 00:00:00 2001 From: Revanth <109272714+revanth1718@users.noreply.github.com> Date: Thu, 6 Jun 2024 23:52:03 +0530 Subject: [PATCH 1/3] bug fixed --- streamlit/home.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/streamlit/home.py b/streamlit/home.py index c8cd49c..08bfcd3 100644 --- a/streamlit/home.py +++ b/streamlit/home.py @@ -8,9 +8,6 @@ from scipy.stats import norm from scipy import stats import random -import functions as ff -import main_analysis as main -import os ####################################### # DATA LOADING @@ -18,27 +15,23 @@ st.set_page_config(layout='wide') -# Determine the base path -base_path = os.path.dirname(__file__) - -# Loading data files -df = pd.read_csv(os.path.join(base_path, 'df2020.csv')) -df2018 = pd.read_csv(os.path.join(base_path, 'df2018.csv')) -full_data2018 = pd.read_csv(os.path.join(base_path, 'survey_results_sample_2018.csv')) -full_data2019 = pd.read_csv(os.path.join(base_path, 'survey_results_sample_2019.csv')) -full_df2020 = pd.read_csv(os.path.join(base_path, 'survey_results_sample_2020.csv')) -df2019 = pd.read_csv(os.path.join(base_path, 'df2019.csv')) +# Loading data files from the 'streamlit' directory +df = pd.read_csv('streamlit/df2020.csv') +df2018 = pd.read_csv('streamlit/df2018.csv') +full_data2018 = pd.read_csv('streamlit/survey_results_sample_2018.csv') +full_data2019 = pd.read_csv('streamlit/survey_results_sample_2019.csv') +full_df2020 = pd.read_csv('streamlit/survey_results_sample_2020.csv') +df2019 = pd.read_csv('streamlit/df2019.csv') # Filter the 2020 dataframe df2020 = df[df['SalaryUSD'] < 200000] # Load CSS file def local_css(file_name): - css_path = os.path.join(base_path, file_name) - with open(css_path) as f: + with open(file_name) as f: st.markdown(f'', unsafe_allow_html=True) -local_css("style.css") +local_css("streamlit/style.css") ####################################### # DATA PREPARATION FOR VISUALISATION From 82f5944690a719118f10d5f8c37e1e256a8fcca3 Mon Sep 17 00:00:00 2001 From: Revanth <109272714+revanth1718@users.noreply.github.com> Date: Thu, 6 Jun 2024 23:59:20 +0530 Subject: [PATCH 2/3] bug fixed --- streamlit/home.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/streamlit/home.py b/streamlit/home.py index 08bfcd3..f0615fa 100644 --- a/streamlit/home.py +++ b/streamlit/home.py @@ -8,6 +8,9 @@ from scipy.stats import norm from scipy import stats import random +import functions as ff +import main_analysis as main + ####################################### # DATA LOADING @@ -196,3 +199,4 @@ def plot_value_counts(column_name): """ st.markdown(highest_paying_ds_text, unsafe_allow_html=True) + \ No newline at end of file From 814522dc902b5bbd0cec8fcb3bd9b96e74100ea5 Mon Sep 17 00:00:00 2001 From: Revanth <109272714+revanth1718@users.noreply.github.com> Date: Fri, 7 Jun 2024 00:10:38 +0530 Subject: [PATCH 3/3] bug fixed --- streamlit/functions.py | 14 +++++++------- streamlit/main_analysis.py | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/streamlit/functions.py b/streamlit/functions.py index ce9b767..69f9aae 100644 --- a/streamlit/functions.py +++ b/streamlit/functions.py @@ -9,16 +9,16 @@ from scipy.stats import norm import re -data = pd.read_csv('df2020.csv') -df2018 = pd.read_csv('df2018.csv') -full_data2018 = pd.read_csv('survey_results_sample_2018.csv') -full_data2019=pd.read_csv('survey_results_sample_2019.csv') -full_df2020 = pd.read_csv('survey_results_sample_2020.csv') -df2019 = pd.read_csv('df2019.csv') +data = pd.read_csv('streamlit/df2020.csv') +df2018 = pd.read_csv('streamlit/df2018.csv') +full_data2018 = pd.read_csv('streamlit/survey_results_sample_2018.csv') +full_data2019=pd.read_csv('streamlit/survey_results_sample_2019.csv') +full_df2020 = pd.read_csv('streamlit/survey_results_sample_2020.csv') +df2019 = pd.read_csv('streamlit/df2019.csv') df2020 = data[(data['SalaryUSD'] < 200000)] # features for job satisfaction -results = pd.read_csv("results.csv") +results = pd.read_csv("streamlit/results.csv") ####################################### diff --git a/streamlit/main_analysis.py b/streamlit/main_analysis.py index bb46a44..0487bbc 100644 --- a/streamlit/main_analysis.py +++ b/streamlit/main_analysis.py @@ -3,16 +3,16 @@ import plotly.express as px import functions as ff -data = pd.read_csv('df2020.csv') -df2018 = pd.read_csv('df2018.csv') -full_data2018 = pd.read_csv('survey_results_sample_2018.csv') -full_data2019=pd.read_csv('survey_results_sample_2019.csv') -full_df2020 = pd.read_csv('survey_results_sample_2020.csv') -df2019 = pd.read_csv('df2019.csv') +data = pd.read_csv('streamlit/df2020.csv') +df2018 = pd.read_csv('streamlit/df2018.csv') +full_data2018 = pd.read_csv('streamlit/survey_results_sample_2018.csv') +full_data2019=pd.read_csv('streamlit/survey_results_sample_2019.csv') +full_df2020 = pd.read_csv('streamlit/survey_results_sample_2020.csv') +df2019 = pd.read_csv('streamlit/df2019.csv') df2020 = data[(data['SalaryUSD'] < 200000)] # features for job satisfaction -results = pd.read_csv("results.csv") +results = pd.read_csv("streamlit/results.csv") # for hightest paying ds full_data2018.rename(columns={'ConvertedSalary': 'SalaryUSD'}, inplace=True)