{"id":22340,"library":"scikit-posthocs","title":"scikit-posthocs","description":"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.","status":"active","version":"0.12.0","language":"python","source_language":"en","source_url":"https://github.com/maximtrp/scikit-posthocs","tags":["post-hoc","statistics","pairwise-comparison","nenemyi","dunn","outlier-detection"],"install":[{"cmd":"pip install scikit-posthocs","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"core math operations","package":"numpy","optional":false},{"reason":"data table manipulation","package":"pandas","optional":false},{"reason":"statistical functions (e.g., stats.chi2, rankdata)","package":"scipy","optional":false},{"reason":"some post-hoc tests rely on statsmodels functionality","package":"statsmodels","optional":true},{"reason":"plotting critical difference diagrams","package":"matplotlib","optional":true}],"imports":[{"note":"The submodule posthocs does not exist; all functions are in top-level.","wrong":"from scikit_posthocs.posthocs import posthoc_nemenyi_friedman","symbol":"posthoc_nemenyi_friedman","correct":"from scikit_posthocs import posthoc_nemenyi_friedman"}],"quickstart":{"code":"import numpy as np\nfrom scikit_posthocs import posthoc_nemenyi_friedman\n\ndata = np.array([   [1,2,3],\n                     [2,3,4],\n                     [3,4,5],\n                     [4,5,6] ])\n\nresult = posthoc_nemenyi_friedman(data)\nprint(result)","lang":"python","description":"Perform Nemenyi post-hoc test after Friedman test. Input data: rows = subjects, columns = treatments. Output: pairwise p-value matrix."},"warnings":[{"fix":"Update to use named arguments: posthoc_nemenyi_friedman(data, group_col='groups')","message":"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.","severity":"breaking","affected_versions":"<0.8.0"},{"fix":"Replace outliers_iqr(data) with outlier_test(data, method='iqr')","message":"The function 'outliers_iqr' was removed in v0.10.0. Use 'outlier_test' instead or handle IQR manually.","severity":"breaking","affected_versions":"<0.10.0"},{"fix":"Replace sign_array(...) with sign_plot(...) (same arguments).","message":"The 'sign_array' function is deprecated since v0.11.0. Use 'sign_plot' instead for visualization.","severity":"deprecated","affected_versions":"0.11.0 - 0.12.0"},{"fix":"Always verify data shape: data.shape should be (subjects, treatments).","message":"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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install with pip install scikit-posthocs and import from scikit_posthocs (underscore).","cause":"Misspelled package name or wrong import path. The package is 'scikit-posthocs' on PyPI but the module is 'scikit_posthocs' (underscore, not hyphen).","error":"ImportError: cannot import name 'posthoc_nemenyi_friedman' from 'scikit_posthocs'"},{"fix":"Ensure your data array has at least 3 columns (e.g., data.shape[1] >= 3).","cause":"Post-hoc tests require at least 3 groups (treatments). You passed data with only 2 columns.","error":"ValueError: The number of groups must be > 2"},{"fix":"Use posthoc_nemenyi_friedman(data=your_data) or just your_data as first argument if using version >=0.8.0.","cause":"In old code (pre-v0.8.0), the first argument was 'a'. Now it's 'data'.","error":"TypeError: posthoc_nemenyi_friedman() missing 1 required positional argument: 'data'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}