Python: how to iterate over dataframes while using their name as a string?
<p>I have three different <code>Pandas</code> dataframes</p>

<pre><code>df_1
df_2
df_3
</code></pre>

<p>I would like to loop over the dataframes, do some computations, and store the output using the <code>name</code> of the dataframe. In other words, something like this</p>

<pre><code>for my_df in [df_1, df_2, df_3]:
  my_df.reset_index(inplace=True)
  my_df.to_csv('mypath/' + my_df +'.csv')
</code></pre>

<p>Output files expected: </p>

<p><code>'mypath/df_1.csv'</code>,  <code>'mypath/df_2.csv'</code> and  <code>'mypath/df_3.csv'</code></p>

<p>I am struggling doing so because <code>df_1</code> is an object, and not a string.
Any ideas how to do that?</p>

<p>Thanks!</p>