title: ptest on groupby() python
body: <p>I've a dataframe as below:</p>
  
  <pre><code>Region   Votes
  
      A          23
      B          26
      A          32
      B          46
      A          32
      B          24
  </code></pre>
  
  <p>I calculated mean of votes for region A and B by following code <code>data.groupby('Region')['Votes'].mean()</code>.Now I've to do ptest to determine whether this difference is statistically significant.I tried this code </p>
  
  <pre><code>one = data[data['Region']=='one']
  two = data[data['Region']=='two']
  
  print(st.ttest_ind(one['Votes'], two['Votes'])).
  </code></pre>
  
  <p>I'm getting nan in output instead of values i.e</p>
  
  <pre><code>  Ttest_indResult(statistic=nan, pvalue=nan)
  </code></pre>
  
  <p>Can somebody tell me what I'm doing wrong?</p>