I have three different Pandas dataframes
df_1
df_2
df_3
I would like to loop over the dataframes, do some computations, and store the output using the name of the dataframe. In other words, something like this
for my_df in [df_1, df_2, df_3]:
my_df.reset_index(inplace=True)
my_df.to_csv('mypath/' + my_df +'.csv')
Output files expected:
'mypath/df_1.csv', 'mypath/df_2.csv' and 'mypath/df_3.csv'
I am struggling doing so because df_1 is an object, and not a string.
Any ideas how to do that?
Thanks!