ks_2samp#
- scipy.stats.mstats.ks_2samp(data1, data2, alternative='two-sided', method='auto')[source]#
Computes the Kolmogorov-Smirnov test on two samples.
Missing values in x and/or y are discarded.
Deprecated since version 2.0.0:
scipy.stats.mstats.ks_2sampis deprecated as of SciPy 2.0.0 and will be removed, along with thescipy.stats.mstatsnamespace, in SciPy 2.4.0. For similar functionality, usescipy.stats.ks_2sampwith MArray(s) instead of NumPy masked array(s).- Parameters:
- data1array_like
First data set
- data2array_like
Second data set
- alternative{‘two-sided’, ‘less’, ‘greater’}, optional
Indicates the alternative hypothesis. Default is ‘two-sided’.
- method{‘auto’, ‘exact’, ‘asymp’}, optional
Defines the method used for calculating the p-value. The following options are available (default is ‘auto’):
‘auto’ : use ‘exact’ for small size arrays, ‘asymp’ for large
‘exact’ : use approximation to exact distribution of test statistic
‘asymp’ : use asymptotic distribution of test statistic
- Returns:
- dfloat
Value of the Kolmogorov Smirnov test
- pfloat
Corresponding p-value.