scipy.stats.mannwhitneyu¶

scipy.stats.
mannwhitneyu
(x, y, use_continuity=True, alternative=None)[source]¶ Compute the MannWhitney rank test on samples x and y.
 Parameters
 x, yarray_like
Array of samples, should be onedimensional.
 use_continuitybool, optional
Whether a continuity correction (1/2.) should be taken into account. Default is True.
 alternative{None, ‘twosided’, ‘less’, ‘greater’}, optional
Defines the alternative hypothesis. The following options are available (default is None):
None: computes pvalue half the size of the ‘twosided’ pvalue and a different U statistic. The default behavior is not the same as using ‘less’ or ‘greater’; it only exists for backward compatibility and is deprecated.
‘twosided’
‘less’: onesided
‘greater’: onesided
Use of the None option is deprecated.
 Returns
 statisticfloat
The MannWhitney U statistic, equal to min(U for x, U for y) if alternative is equal to None (deprecated; exists for backward compatibility), and U for y otherwise.
 pvaluefloat
pvalue assuming an asymptotic normal distribution. Onesided or twosided, depending on the choice of alternative.
Notes
Use only when the number of observation in each sample is > 20 and you have 2 independent samples of ranks. MannWhitney U is significant if the uobtained is LESS THAN or equal to the critical value of U.
This test corrects for ties and by default uses a continuity correction.
References
 1
 2
H.B. Mann and D.R. Whitney, “On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other,” The Annals of Mathematical Statistics, vol. 18, no. 1, pp. 5060, 1947.