title: Two-sample Kolmogorov-Smirnov Test in Python Scipy
body: <p>I can't figure out how to do a Two-sample KS test in Scipy.</p>
  
  <p>After reading the documentation <a href="http://docs.scipy.org/doc/scipy-0.7.x/reference/generated/scipy.stats.kstest.html" rel="noreferrer">scipy kstest</a></p>
  
  <p>I can see how to test where a distribution is identical to standard normal distribution</p>
  
  <pre><code>from scipy.stats import kstest
  import numpy as np
  
  x = np.random.normal(0,1,1000)
  test_stat = kstest(x, 'norm')
  #&gt;&gt;&gt; test_stat
  #(0.021080234718821145, 0.76584491300591395)
  </code></pre>
  
  <p>Which means that at p-value of 0.76 we can not reject the null hypothesis that the two distributions are identical.</p>
  
  <p>However, I want to compare two distributions and see if I can reject the null hypothesis that they are identical, something like:</p>
  
  <pre><code>from scipy.stats import kstest
  import numpy as np
  
  x = np.random.normal(0,1,1000)
  z = np.random.normal(1.1,0.9, 1000)
  </code></pre>
  
  <p>and test whether x and z are identical</p>
  
  <p>I tried the naive:</p>
  
  <pre><code>test_stat = kstest(x, z)
  </code></pre>
  
  <p>and got the following error:</p>
  
  <pre><code>TypeError: 'numpy.ndarray' object is not callable
  </code></pre>
  
  <p>Is there a way to do a two-sample KS test in Python? If so, how should I do it?</p>
  
  <p>Thank You in Advance</p>