title: Python/Pandas if statement and index
body: <p>I'm sure there is a simple solution to this problem but I cannot seem to find it. </p>
  
  <p>I am trying to check if an age from a list is in the age column of my dataframe. However, it is only comparing to the index and not the column. </p>
  
  <p>Here is a simplified piece of code from my program:</p>
  
  <pre><code>def findages(data,ages):
      for age in ages:
          if age in data['age']:
              print('yes')
          else:
              print('no')
  </code></pre>
  
  <p>I have also tried this:</p>
  
  <pre><code>def findages(data,ages):
      for age in ages:
          if age in data.loc[data['age']]:
              print('yes')
          else:
              print('no')
  </code></pre>
  
  <p>the dataframe looks like this</p>
  
  <pre><code>                 age     x     Lambda             L
  0       1.258930e+05  0.01       91.0  5.349000e+25
  1       1.258930e+05  0.01       94.0  1.188800e+26
  2       1.258930e+05  0.01       96.0  1.962700e+26
  3       1.258930e+05  0.01       98.0  3.169400e+26   
  4       1.258930e+05  0.01      100.0  5.010800e+26
  </code></pre>
  
  <p>and the list like this:</p>
  
  <pre><code>ages = ([125893.0, 4e7,5e9])
  </code></pre>
  
  <p>What am I doing wrong? </p>