title: Counting grouped data with missing values in pandas dataframe
body: <p>I am trying to do something like this, but on a much larger dataframe (called Clean):</p>
  
  <pre><code>d={'rx': [1,1,1,1,2.1,2.1,2.1,2.1],
       'vals': [NaN,10,10,20,NaN,10,20,20]}
  df=DataFrame(d)
  
  
  arrays = [df.rx,df.vals]                    
  index = pd.MultiIndex.from_arrays(arrays, names = ['rx','vals'])           
  df.index = index
  
  Hist=df.groupby(level=('rx','vals'))
  Hist.count('vals')
  </code></pre>
  
  <p>This seems to work just fine, but when I run the same concept on even a subset of the Clean dataframe (substituting a column 'LagBin' for 'vals') I get an error:</p>
  
  <pre><code>df1=DataFrame(data=Clean,columns=('rx','LagBin'))
  df1=df1.head(n=20)
  
  arrays = [df1.rx,df1.LagBin]                    
  index = pd.MultiIndex.from_arrays(arrays, names = ['rx','LagBin'])            
  df1.index = index
  
  Hist=df1.groupby(level=('rx','LagBin'))
  Hist.count('LagBin')
  </code></pre>
  
  <p>Specifically, the Hist.count('LagBin') produces a value error:</p>
  
  <pre><code>ValueError: Cannot convert NA to integer
  </code></pre>
  
  <p>I have looked at the data structure and that all seems exactly the same.</p>
  
  <p>Here is the data that produces the error:</p>
  
  <pre><code>rx  LagBin  rx  LagBin
  139.1  nan  139.1   
  139.1  0    139.1   0
  139.1  0    139.1   0
  139.1  0    139.1   0
  141.1  nan  141.1   
  141.1  10   141.1   10
  141.1  20   141.1   20
  193    nan  193 
  193    50   193     50
  193    20   193     20
  193    3600 193     3600
  193    50   193     50
  193    0    193     0
  193    20   193     20
  193    10   193     10
  193    110  193     110
  193    80   193     80
  193    460  193     460
  193    30   193     30
  193    0    193     0
  </code></pre>
  
  <p>while the original routine that works produces this:</p>
  
  <pre><code>rx  vals    rx  vals
  1   nan     1   
  1   10      1   10
  1   10      1   10 
  1   20      1   20
  2.1 nan     2.1 
  2.1 10      2.1 10
  2.1 20      2.1 20
  2.1 20      2.1 20
  </code></pre>
  
  <p>What is different about these datasets that produces this error?</p>