Hello All !
I’m trying to deploy some dash code to render and got stuck with “FileNotFoundError: [Errno 2] No such file or directory: ‘PM25_disease/pollution_analysis/data/GBD2019 at main · DSAGRO3F/PM25_disease · GitHub’”
Here is project structure:
Here are first lines of db_app.py code where path variable is initialized,
path = 'https://github.com/DSAGRO3F/PM25_disease/tree/main/pollution_analysis/data/GBD2019'
def load_dfs(path):
l_df = []
l_words = []
l_years = []
list_files = [file for file in os.listdir(path) if file.endswith('.csv')]
l_1 = [file for file in list_files if 'Lower' not in file]
l_2 = [file for file in l_1 if 'Upper' not in file]
l_3 = [file for file in l_2 if 'GEMM' not in file]
l_4 = [file for file in l_3 if 'MRBRT' not in file]
nb_elements = len(l_4)
#print(f'nb_elements dans l_4 : {nb_elements}')
#print(f'l_4 : {l_4}')
#restricted_words_list = ['COPD', 'DM', 'IHD', 'LBW', 'LC', 'LRI', 'PTB', 'Stroke']
for file in l_4:
idx = l_4.index(file)
if idx < nb_elements:
words_in_name_file = file.split('_')
if words_in_name_file[0] != 'CoExposure':
year = file.split('_')[-4]
word = file.split('_')[-1].split('.')[-2]
l_years.append(year)
l_words.append(word)
df = pd.read_csv(path+'/'+file)
l_df.append(df)
else:
df = pd.read_csv(path+'/'+file)
df_iso = df.loc[:, ['Location', 'ISO3']]
return l_years, l_words, l_df, df_iso
l_years, l_words, l_df, df_iso = load_dfs(path)
list_of_d_words = [{str(word): word} for word in l_words]
list_of_d_years = [{str(year): year} for year in l_years]
I am wrong somewhere but cannot say where for now,
Thank you for your help on this !