scikit-posthocs
raw JSON → 0.12.0 verified Mon Apr 27 auth: no python
Statistical post-hoc analysis and outlier detection algorithms for Python. Provides pairwise multiple comparison tests (e.g., Nemenyi, Conover, Dunn, Bonferroni) and outlier detection (e.g., IQR, Grubbs). Current version: 0.12.0. Release cadence is irregular, major updates every 1-2 years.
pip install scikit-posthocs Common errors
error ImportError: cannot import name 'posthoc_nemenyi_friedman' from 'scikit_posthocs' ↓
cause Misspelled package name or wrong import path. The package is 'scikit-posthocs' on PyPI but the module is 'scikit_posthocs' (underscore, not hyphen).
fix
Install with pip install scikit-posthocs and import from scikit_posthocs (underscore).
error ValueError: The number of groups must be > 2 ↓
cause Post-hoc tests require at least 3 groups (treatments). You passed data with only 2 columns.
fix
Ensure your data array has at least 3 columns (e.g., data.shape[1] >= 3).
error TypeError: posthoc_nemenyi_friedman() missing 1 required positional argument: 'data' ↓
cause In old code (pre-v0.8.0), the first argument was 'a'. Now it's 'data'.
fix
Use posthoc_nemenyi_friedman(data=your_data) or just your_data as first argument if using version >=0.8.0.
Warnings
breaking In v0.8.0+, the function signature changed: argument names switched from 'a' to 'data' and 'group' to 'group_col' (where applicable). Old code using positional arguments may break. ↓
fix Update to use named arguments: posthoc_nemenyi_friedman(data, group_col='groups')
breaking The function 'outliers_iqr' was removed in v0.10.0. Use 'outlier_test' instead or handle IQR manually. ↓
fix Replace outliers_iqr(data) with outlier_test(data, method='iqr')
deprecated The 'sign_array' function is deprecated since v0.11.0. Use 'sign_plot' instead for visualization. ↓
fix Replace sign_array(...) with sign_plot(...) (same arguments).
gotcha Input data must be a 2D array-like (n_subjects x n_treatments). If you pass a 1D array or accidentally transpose, results will be wrong without error. ↓
fix Always verify data shape: data.shape should be (subjects, treatments).
Imports
- posthoc_nemenyi_friedman wrong
from scikit_posthocs.posthocs import posthoc_nemenyi_friedmancorrectfrom scikit_posthocs import posthoc_nemenyi_friedman
Quickstart
import numpy as np
from scikit_posthocs import posthoc_nemenyi_friedman
data = np.array([ [1,2,3],
[2,3,4],
[3,4,5],
[4,5,6] ])
result = posthoc_nemenyi_friedman(data)
print(result)