title: Input format for Kruskal-Wallis test in Python
body: <p>I am comparing regions in the DNA on structural breaks in cancer patients and healthy people. I am trying to run a Kruskal-Wallis test (SciPy Stats) on the number of breaks for each region, to see if there is a difference between the two distributions. 
  I am not sure if the input for the Kruskal - Wallis should be arrays (documentation), or a list of arrays (elsewhere on the internet).</p>
  
  <p>First, I tried an array for sample+control like this: </p>
  
  <pre><code>controls = ['1', '2', '3', '4', '5']
  samples = ['10', '20', '30', '40', '50']
  n=0
  for item in controls:
      array_item = np.array([item, samples[n]])
      kw_test = stats.mstats.kruskalwallis(array_item)
      print(kw_test)
      n+=1
  </code></pre>
  
  <p>That gave me the following output for all items:</p>
  
  <pre><code>(0.0, nan)
  </code></pre>
  
  <p>I also tried converting the individual datapoints in arrays, and then run the KW-test.</p>
  
  <pre><code>controls = ['1', '2', '3', '4', '5']
  samples = ['10', '20', '30', '40', '50']
  n=0
  kw_results = []
  for item in controls:
      array_controls = np.array([item])
      array_samples = np.array([samples[n]])
      kw_test = stats.mstats.kruskalwallis(array_samples, array_controls)
      kw_results.append(kw_test)
      n+=1
  print(kw_results)
  </code></pre>
  
  <p>That gave <code>(1.0, 0.31731050786291404)</code> for all comparisons, even when I changed one of the lists drastically.</p>
  
  <p>Digging deeper,  I read that the input should be a list of arrays, so I thought that giving only two datapoints (one sample, one control) might have caused the '(0.0, nan)', so I tried that as well.</p>
  
  <pre><code>controls = ['1', '2', '3', '4', '5']
  samples = ['10', '20', '30', '40', '50']
  list_ = []
  n=0
  for item in controls:
      array_item = np.array([item, samples[n]])
      list_.append(array_item)
      n+=1
  kw_test = stats.mstats.kruskalwallis(list_)
  print(kw_test)
  </code></pre>
  
  <p>That gave me this error:</p>
  
  <pre><code>TypeError: Not implemented for this type
  </code></pre>
  
  <p>Now I am not sure what format/type to use, hopefully anyone can help me out!</p>