title: Pandas Passing Variable Names into Column Name
body: <p>I have a dataframe that contains 13 different column names, I have separated these headings into two lists. I now want to perform different operations on each of these lists. </p>
  
  <p>Is it possible to pass column names into pandas as a variable? My code at the moment can loop through the list fine but i am having trouble trying to pass the column name into the function</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>CONT = ['age','fnlwgt','capital-gain','capital-loss']
  #loops through columns
  for column_name, column in df.transpose().iterrows():
      if column_name in CONT:
          X = column_name
          print(df.X.count())
      else:
          print('')
  </code></pre>