title: How to get scalar value on a cell using conditional indexing
body: <p>I have the dataframe shown below. I need to get the scalar value of column B, dependent on the value of A (which is a variable in my script). I'm trying the loc() function but it returns a Series instead of a scalar value. How do I get the scalar value()?</p>
  
  <pre><code>&gt;&gt;&gt; x = pd.DataFrame({'A' : [0,1,2], 'B' : [4,5,6]})
  &gt;&gt;&gt; x
     A  B
  0  0  4
  1  1  5
  2  2  6
  
  &gt;&gt;&gt; x.loc[x['A'] == 2]['B']
  2    6
  Name: B, dtype: int64
  
  &gt;&gt;&gt; type(x.loc[x['A'] == 2]['B'])
  &lt;class 'pandas.core.series.Series'&gt;
  </code></pre>