I want to explore the possibility of using the Kolmogorov-Smirnov goodness of fit test to determine whether an array of experimental data fits an array of previously defined theoretical expectations. To try and see how the predefined scipy.stats.kstest() function works, I did the following: import scipy.stats as stats a=[1,2,3,4,5] b=[2,3,3,4,6] stat,p=stats.kstest(a,b,alternative='two-sided') The output is: RuntimeWarning: ks_2samp: Exact calculation unsuccessful. Switching to method=asymp. return ks_2samp(xvals, yvals, alternative=alternative, method=method) I don't understand the reason behind the RuntimeWarning. After investigating the issue a bit, I found out that the second argument has to be a callable and not an array of expected values... is there any way to make it work like I was trying to here? Continue reading...