title: select a value from dataframe with for loop
body: <p>I'm using python and I wonder how to select an individual value from a dataframe. I need to select this value from an interaction and then use it in an equation, so is a variable number.</p>
  
  <p>My dataframe looks as follows:</p>
  
  <pre><code>df
  
             B
    A                     
   114    0.1452
   117    0.1855
   122    0.2005
  </code></pre>
  
  <p>Then, I use a list containing values of column A</p>
  
  <p><code>My_list = [114, 117, 122]</code></p>
  
  <p>and I need to extract the values of column B, one at a time, so I'm using:</p>
  
  <pre><code>for i in My_list:
  
      z = df.at[[i],'B']
  </code></pre>
  
  <p>these give me : <code>TypeError:'[114]' is an invalid key</code></p>