title: Loop through different Pandas Dataframes
body: <p>im new to Python, and have what is probably a basis question.</p>
  
  <p>I have imported a number of Pandas Dataframes consisting of stock data for different sectors. So all columns are the same, just with different dataframe names.</p>
  
  <p>I need to do a lot of different small operations on some of the columns, and I can figure out how to do it on one Dataframe at a time, but I need to figure out how to loop over the different frames and do the same operations on each.</p>
  
  <p>For example for one DF i do:</p>
  
  <pre><code>ConsumerDisc['IDX_EST_PRICE_BOOK']=1/ConsumerDisc['IDX_EST_PRICE_BOOK']
  ConsumerDisc['IDX_EST_EV_EBITDA']=1/ConsumerDisc['IDX_EST_EV_EBITDA']
  ConsumerDisc['INDX_GENERAL_EST_PE']=1/ConsumerDisc['INDX_GENERAL_EST_PE']
  ConsumerDisc['EV_TO_T12M_SALES']=1/ConsumerDisc['EV_TO_T12M_SALES']
  ConsumerDisc['CFtoEarnings']=ConsumerDisc['CASH_FLOW_PER_SH']/ConsumerDisc['TRAIL_12M_EPS']
  </code></pre>
  
  <p>And instead of just copying and pasting this code for the next 10 sectors, I want to to do it in a loop somehow, but I cant figure out how to access the df via variable, eg: </p>
  
  <pre><code>CS=['ConsumerDisc']
  CS['IDX_EST_PRICE_BOOK']=1/CS['IDX_EST_PRICE_BOOK'] 
  </code></pre>
  
  <p>so I could just create a list of df names and loop through it.</p>
  
  <p>Hope you can give a small example as how to do this.</p>