scipy.stats.mannwhitneyu¶

scipy.stats.
mannwhitneyu
(x, y, use_continuity=True, alternative=None)[source]¶ Computes the MannWhitney rank test on samples x and y.
Parameters: x, y : array_like
Array of samples, should be onedimensional.
use_continuity : bool, optional
Whether a continuity correction (1/2.) should be taken into account. Default is True.
alternative : None (deprecated), ‘less’, ‘twosided’, or ‘greater’
Whether to get the pvalue for the onesided hypothesis (‘less’ or ‘greater’) or for the twosided hypothesis (‘twosided’). Defaults to None, which results in a 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.
Returns: statistic : float
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.
pvalue : float
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.