title: Value counts in pandas leads to error
body: <p>I have a program:</p>
  
  <pre><code>import pandas
  import numpy
  
  data = pandas.read_csv('gapminder.csv', low_memory=False)
  
  data['employrate'] = data['employrate'].convert_objects(convert_numeric=True)
  data['urbanrate'] = data['urbanrate'].convert_objects(convert_numeric=True)
  data['internetuserate'] = data['internetuserate'].convert_objects(convert_numeric=True)
  
  print('counts for employrate')
  filtered_employrate_data = data['employrate'][data['employrate'].notnull()]
  employrate_count_factor = pandas.qcut(filtered_employrate_data, 10)
  print(employrate_count_factor)
  employrate_count = filtered_employrate_data.value_counts(employrate_count_factor)
  print(employrate_count)
  </code></pre>
  
  <p>When I execute it I get:</p>
  
  <blockquote>
    <p>ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().</p>
  </blockquote>
  
  <p>Some results of qcut are NaN. So I decided to use notnull but took error again. </p>
  
  <p>I am looking for the reason for this error and how to resolve it.</p>
  
  <p>Here is a full error message:</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-1-293e5b5ef38c&gt;", line 1, in &lt;module&gt;
      runfile('D:/new/Assignment Week 2.py', wdir='D:/new')
  
    File "C:\Users\AOkunev\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
      execfile(filename, namespace)
  
    File "C:\Users\AOkunev\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 85, in execfile
      exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
  
    File "D:/new/Assignment Week 2.py", line 21, in &lt;module&gt;
      employrate_count = filtered_employrate_data.value_counts(employrate_count_factor)
  
    File "C:\Users\AOkunev\AppData\Local\Continuum\Anaconda3\lib\site-packages\pandas\core\base.py", line 430, in value_counts
      normalize=normalize, bins=bins, dropna=dropna)
  
    File "C:\Users\AOkunev\AppData\Local\Continuum\Anaconda3\lib\site-packages\pandas\core\algorithms.py", line 262, in value_counts
      if normalize:
  
    File "C:\Users\AOkunev\AppData\Local\Continuum\Anaconda3\lib\site-packages\pandas\core\generic.py", line 714, in __nonzero__
      .format(self.__class__.__name__))
  
  ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  </code></pre>