title: Scipy Stats Wilcoxon X and Y must be one dimensional error
body: <p>I am splitting the 'cnt' variable into two sets based on the value in the 'yr' value so that I can compare the two with a Wilcoxon rank-sum test. I keep getting the error "Samples x and y must be 1-dimensional." Can anyone help me figure out how to fix this? I defined two arrays cnt_yr0 and cnt_yr1 which are 1xn arrays.</p>
  
  <pre><code>#Here is some of my code:
  from scipy import stats as sc
  
  cnt_yr0 = np.transpose(np.array(data.loc[data['yr']==0,['cnt']]))
  cnt_yr1 = np.transpose(np.array(data.loc[data['yr']==1,['cnt']]))
  print(cnt_yr0)
  print(cnt_yr1)
  
  
  #binary predictors with continuous response
  print(sc.wilcoxon(cnt_yr0,cnt_yr1))
  
  [[16 40 32 ... 52 38 31]]
  [[48 93 75 ... 90 61 49]]
  ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-145-16e4c5da6eb0&gt; in &lt;module&gt;
        9 
       10 #binary predictors with continuous response
  ---&gt; 11 print(sc.wilcoxon(cnt_yr0,cnt_yr1))
       12 print(sc.wilcoxon(np.array(data['holiday']),np.array(data['cnt'])))
       13 print(sc.wilcoxon(np.array(data['workingday']),np.array(data['cnt'])))
  
  ~\Anaconda3\lib\site-packages\scipy\stats\morestats.py in wilcoxon(x, y, zero_method, correction, alternative)
     2844         x, y = map(asarray, (x, y))
     2845         if x.ndim &gt; 1 or y.ndim &gt; 1:
  -&gt; 2846             raise ValueError('Samples x and y must be one-dimensional.')
     2847         if len(x) != len(y):
     2848             raise ValueError('The samples x and y must have the same length.')
  
  ValueError: Samples x and y must be one-dimensional.
  </code></pre>