title: How to create dynamic dataframe using python loop?
body: <p>I have a 4 dataframes that I generate for 2 products each, totaling 8 dataframes.</p>
  <p>Currently, I create each dataframe manually such as (very clunky):</p>
  <pre><code>productA = productA.withColumn('col1', productA['col2'] / productA['col3'])
  productA = productA.withColumn('col4', productA['col5'] / productA['col6'])
  productA = productA.withColumn('col7', productA['col8'] / productA['col9'])
  productA = productA.withColumn('col10', productA['col11'] / productA['col12'])
  
  productB = productB.withColumn('col1', productB['col2'] / productB['col3'])
  productB = productB.withColumn('col4', productB['col5'] / productB['col6'])
  productB = productB.withColumn('col7', productB['col8'] / productB['col9'])
  productB = productB.withColumn('col10', productB['col11'] / productB['col12'])
  </code></pre>
  <p>I am trying to make the code lighter by trying to do something like this:</p>
  <pre><code>product=['productA','productB']
  
  for i in product:
      df_i = df_i.withColumn('col1', df_i['col2'] / df_i['col3'])
      df_i = df_i.withColumn('col4', df_i['col5'] / df_i['col6'])
      df_i = df_i.withColumn('col7', df_i['col8'] / df_i['col9'])
      df_i = df_i.withColumn('col10', df_i['col11'] / df_i['col12'])
  </code></pre>
  <p>Is this achievable given that also dataframe suffixed should be created? When I run such code, it does not work.</p>