title: Scalar error when swapping out a hard coded string for a variable with pandas
body: <p><strong>df1</strong> looks something like this:</p>
  
  <pre><code>  name  age
  1 Bobby 17
  2 Sally 23
  3 John  19
  </code></pre>
  
  <p><strong>df2</strong> looks like this:</p>
  
  <pre><code>  name  city      state
  1 Bobby Lakeside  MN
  2 Sally Carlstown MS
  3 John  Wallsburg UT
  </code></pre>
  
  <p>I am looping through a DataFrame, df1, like this:</p>
  
  <pre><code>for row in df1.itertuples(name='Pandas', index=True):
      name = getattr(row, "name")
      print(type(name))
      print(name)
  </code></pre>
  
  <p>and I will get (as expected):</p>
  
  <pre><code>&lt;type 'str'&gt;
  Bobby
  &lt;type 'str'&gt;
  Sally
  &lt;type 'str'&gt;
  John
  </code></pre>
  
  <p>Then I am searching a second dataframe, df2, and getting it's row location (index) number, so I can get additional information.</p>
  
  <pre><code>i = df2[(df2['name'] == "Bobby").index.item()
  </code></pre>
  
  <p><code>i</code> is now the integer... worked like a champ. It found Bobby in the other DataFrame, df2, and walla! Gave me the index number.</p>
  
  <p><strong>However...</strong> if I try swapping out the hard coded string "Bobby" to the variable like this...</p>
  
  <pre><code>for row in df1.itertuples(name='Pandas', index=True):
      name = getattr(row, "name")
      i = df2[(df2['name'] == name)].index.item()
  </code></pre>
  
  <p>then it explodes and dies.</p>
  
  <pre><code>for row in df1.itertuples(name='Pandas', index=True):
      name = getattr(row, "name")
      i = df2[(df2['name'] == str(name))].index.item()
  </code></pre>
  
  <p>I get the following exception:</p>
  
  <pre><code>ValueError: can only convert an array of size 1 to a Python scalar
  </code></pre>
  
  <p>I am at a complete loss, help! and Thank you!</p>