title: Python: split dataframe into multiple dataframes by using for loop with locals function
body: <p>I have a csv file below:</p>
  
  <pre><code>name,apply,percent
  A,101,98%
  B,388,79%
  C,637,88%
  D,541,75%
  E,345,98%
  A,446,85%
  D,211,49%
  </code></pre>
  
  <p>I tried to split dataframe into multiple dataframes as df_A, df_B, df_C, df_D &amp; df_E.</p>
  
  <pre class="lang-py prettyprint-override"><code>for name in df.groupby('name'):
      locals()['df_'.name]=df[(df.name==name)]
       print(df_A)
  </code></pre>
  
  <p>It doesn't work. How to fix the code? Many thanks.</p>