I retrieve several dataframes from spreadsheets of an Excel file.
I would like to store these dataframes into a list so that I can concatenate the dataframes into one dataframe.
However, how can I store the variables themselves instead of their them.
- These are the data frames that I created.
df0120
df0220
df0320
df0419
df0519
df0619
df0719
df0819
df0919
df_lst = list()
for name in dir():
if name.startswith('df0'):
df_lst.append(name)
print(df_lst)
- My results
['df0120', 'df0220'...]
- Expected results
[df0120, df0220 ...]