title: How scipy.stats handles nans?
body: <p>I am trying to do some statistics in Python. I have data with several missing values, filled with <code>np.nan</code>, and I am not sure should I remove it manually, or scipy can handle it. So I tried both:</p>
  
  <pre><code> import scipy.stats, numpy as np
  a = [0.75, np.nan, 0.58337, 0.75, 0.75, 0.91663, 1.0, np.nan, 0.663, 0.837,     0.837, 1.0, 0.663, 1.0, 1.0, 0.91663, 0.75, 0.41669, 0.58337, 0.663, 0.75, 0.58337] 
  b = [0.837, np.nan, 0.663, 0.58337, 0.75, 0.75, 0.58337, np.nan, 0.166, 0.5,     0.663, 1.0, 0.91663, 1.0, 0.663, 0.75, 0.75, 0.41669, 0.331, 0.25, 1.0, 0.91663]
  
  d_1, d_2 = a,b
  wilc1 =  scipy.stats.wilcoxon(d_1, d_2, zero_method = 'pratt')
  
  d_1, d_2 = [], []
  for d1, d2 in zip(a, b):
      if np.isnan(d1) or np.isnan(d2):
          pass
      else:
          d_1.append(d1)
          d_2.append(d2)
  
  wilc2 =  scipy.stats.wilcoxon(d_1, d_2, zero_method = 'pratt')
  print wilc1
  print wilc2
  </code></pre>
  
  <p>I get two runtime warnigs:</p>
  
  <pre><code>C:\Python27\lib\site-packages\scipy\stats\morestats.py:1963: RuntimeWarning: invalid value encountered in greater
    r_plus = sum((d &gt; 0) * r, axis=0
  </code></pre>
  
  <p>and two Wilcoxon outputs</p>
  
  <pre><code>(54.0, 0.018545881687477818)
  (54.0, 0.056806600853965265)
  </code></pre>
  
  <p>As you see, I have two similiar test statisitcs (W), and two different P-values.
  Which is one is correct?</p>
  
  <p>My guess, that Wilcoxon processes missing values correctly during test statistic calculation, but during P-value calculation, it uses len() of all data, not just valid cases. Can this count as bug?</p>