title: Pandas loc does not work to subset DataFrame when using a variable
body: <p>I am fairly new to Python, especially pandas. I have a DataFrame called KeyRow which is from a bigger df:</p>
  <pre><code>KeyRow=df.loc[df['Order'] == UniqueOrderName[i]]
  </code></pre>
  <p>Then I make a nested loop</p>
  <pre><code>for i in range (0,len(PersonNum)):
     print(KeyRow.loc[KeyRow['Aisle'] == '6', 'FixedPill'])
  </code></pre>
  <p>So it appears to only work when a constant is placed, whereas if I use PersonNum[0] instead of '6',even though both values are equivalent, it appears not to work. When I use PersonNum[i] this is the output I am getting:</p>
  <pre><code>Series([], Name: FixedPill, dtype: object)
  </code></pre>
  <p>Whereas if I use 'x' I get a desired result:</p>
  <pre><code>15    5
  Name: FixedPill, dtype: object
  </code></pre>