Skip to content
Back to skills

Mannwhitneyu

ASecurity

Compute the mannwhitneyu metric — provided by scipy.stats. Use when the user has predictions and ground-truth and needs to compute mannwhitneyu, or asks how to score with mannwhitneyu.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 11, 2026
documentationpythonexpress

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill mannwhitneyu --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mannwhitneyu?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mannwhitneyu
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-mannwhitneyu/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-mannwhitneyu)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mannwhitneyu
description: Compute the mannwhitneyu metric — provided by scipy.stats. Use when the user has predictions and ground-truth and needs to compute mannwhitneyu, or asks how to score with mannwhitneyu.
metadata:
  skill_kind: metric
  source_lib: scipy.stats
  import_path: scipy.stats.mannwhitneyu
  source: library_introspection
---

# mannwhitneyu

> Metric `mannwhitneyu` from `scipy.stats` (scipy.stats.mannwhitneyu)

## When to invoke this skill

The user has predictions + ground truth and asks to evaluate with mannwhitneyu, or
mentions `scipy.stats.mannwhitneyu` directly, or wants the standard scipy.stats implementation.

## Reference signature

```python
from scipy.stats import mannwhitneyu

# mannwhitneyu(x, y, use_continuity=True, alternative='two-sided', axis=0, method='auto', *, nan_policy='propagate', keepdims=False)
```

## Library docstring

```
Perform the Mann-Whitney U rank test on two independent samples.

The Mann-Whitney U test is a nonparametric test of the null hypothesis
that the distribution underlying sample `x` is the same as the
distribution underlying sample `y`. It is often used as a test of
difference in location between distributions.

Parameters
----------
x, y : array-like
    N-d arrays of samples. The arrays must be broadcastable except along
    the dimension given by `axis`.
use_continuity : bool, optional
    Whether a continuity correction (1/2) should be applied.
    Default is True when `method` is ``'asymptotic'``; has no effect
    otherwise.
alternative : {'two-sided', 'less', 'greater'}, optional
    Defines the alternative hypothesis. Default is 'two-sided'.
    Let *SX(u)* and *SY(u)* be the survival functions of the
    distributions underlying `x` and `y`, respectively. Then the following
    alternative hypotheses are available:

    * 'two-sided': the distributions are not equal, i.e. *SX(u) ≠ SY(u)* for
      at least one *u*.
    * 'less': the distribution underlying `x` is stochastically less
      than the distribution underlying `y`, i.e. *SX(u) < SY(u)* for all *u*.
    * 'greater': the distribution underlying `x` is stochastically greater
      than the distribution underlying `y`, i.e. *SX(u) > SY(u)* for all *u*.

    Under a more restrictive set of assumptions, the alternative hypotheses
    can be expressed in terms of the locations of the distributions;
    see [5]_ section 5.1.
axis : int or None, default: 0
    If an int, the axis of the input along which to compute the statistic.
    The statistic of each axis-slice (e.g. row) of the input will appear in a
    corresponding element of the output.
    If ``None``, the input will be raveled before computing the statistic.
method : {'auto', 'asymptotic', 'exact'} or `PermutationMethod` instance, optional
    Selects the method used to calculate the *p*-value.
    Default is 'auto'. The following options are available.

    * ``'asymptotic'``: compares the standardized test statistic
      against the normal distribution, correcting for ties.
    * ``'exact'``: computes the exact *p*-value by comparing the
```

## Quick recipe

```python
import scipy.stats as _m
score = _m.mannwhitneyu(y_true, y_pred)
```

## Don'ts

- Don't reimplement when the library version handles edge cases (NaN, ties, empty inputs) better than a hand-rolled formula.
- Always check the library version's argument order — sklearn is `(y_true, y_pred)` while torchmetrics is `(preds, target)`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.