def read_inputs(filename_dict_): ''' Read input files input: Dictionary with table and corresponding filename return: Dataframes for each input table ''' list_df = [] for table, filename in filename_dict_.items(): if table == 'df1': df_cdpos = parse_cdpos('df1.txt') list_df.append(df_cdpos) else: exec("df_{} = pd.read_excel('{}')".format(table,filename)) exec("list_df.append(df_{})".format(table)) print(table, ' loaded!') return list_df
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter