{"id":5794,"library":"pingouin","title":"Pingouin","description":"Pingouin is an open-source statistical package written in Python 3 and based mostly on Pandas and NumPy. It provides a comprehensive yet user-friendly set of functions for various statistical tests, including ANOVAs, correlations, regressions, Bayes Factors, effect sizes, and reliability analysis. The current stable version is 0.6.1, and the library maintains a frequent release cadence with ongoing development.","status":"active","version":"0.6.1","language":"python","source_language":"en","source_url":"https://github.com/raphaelvallat/pingouin","tags":["statistics","data analysis","scientific computing","pandas","numpy","biostatistics","psychology"],"install":[{"cmd":"pip install pingouin","lang":"bash","label":"pip"},{"cmd":"conda install -c conda-forge pingouin","lang":"bash","label":"Conda (Conda-Forge)"}],"dependencies":[{"reason":"Core numerical operations.","package":"numpy","optional":false},{"reason":"Underlying statistical functions.","package":"scipy","optional":false},{"reason":"Data manipulation and DataFrame output for results.","package":"pandas","optional":false},{"reason":"Enhances Pandas integration.","package":"pandas_flavor","optional":false},{"reason":"Advanced statistical modeling.","package":"statsmodels","optional":false},{"reason":"Plotting capabilities.","package":"matplotlib","optional":false},{"reason":"Enhanced data visualization.","package":"seaborn","optional":false},{"reason":"Machine learning utilities, e.g., for regression.","package":"scikit-learn","optional":false},{"reason":"Formatting tabular data.","package":"tabulate","optional":false},{"reason":"Additional functionality for some functions, optional.","package":"mpmath","optional":true}],"imports":[{"note":"Standard import for accessing all Pingouin functions.","symbol":"pingouin","correct":"import pingouin as pg"},{"note":"Import specific functions directly to avoid namespace pollution if only a few functions are needed.","symbol":"ttest","correct":"from pingouin import ttest"}],"quickstart":{"code":"import pingouin as pg\nimport numpy as np\nimport pandas as pd\n\n# Simulate two independent groups of data\nnp.random.seed(123)\ndata_group1 = np.random.normal(loc=10, scale=2, size=30)\ndata_group2 = np.random.normal(loc=12, scale=2.5, size=30)\n\n# Perform an independent samples t-test\nresult = pg.ttest(data_group1, data_group2, correction='auto')\n\nprint(result)\n\n# Example with a DataFrame for ANOVA\ndf_anova = pd.DataFrame({\n    'dv': [10, 12, 11, 13, 15, 14, 16, 18, 17, 19, 20, 22],\n    'group': ['A']*4 + ['B']*4 + ['C']*4\n})\naov_result = pg.anova(data=df_anova, dv='dv', between='group')\nprint(\"\\nANOVA Result:\")\nprint(aov_result)","lang":"python","description":"This quickstart demonstrates performing an independent samples t-test and a one-way ANOVA using Pingouin. It highlights the library's ability to take raw numerical arrays or Pandas DataFrames and return rich statistical output in a DataFrame format, including T-values, p-values, degrees of freedom, effect sizes (e.g., Cohen's d), and power."},"warnings":[{"fix":"Remove calls to `plot_shift` and use alternative plotting libraries like Matplotlib or Seaborn for similar visualizations, or revert to an older version if absolutely necessary.","message":"The `plot_shift` function was removed in Pingouin 0.6.0. Any code relying on this function will break.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Upgrade SciPy to at least version 1.10.0: `pip install --upgrade scipy`.","message":"The minimum required SciPy version for `compute_bootci` was bumped to 1.10.0 in Pingouin 0.6.0. Ensure your SciPy installation meets this requirement to avoid `ImportError` or unexpected behavior.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Replace `pg.gzscore()` with `scipy.stats.gzscore()`.","message":"The `pingouin.gzscore()` function is deprecated and will be removed in a future release. It is recommended to use `scipy.stats.gzscore()` instead for robust z-score calculation.","severity":"deprecated","affected_versions":">=0.5.0"},{"fix":"Be aware of missing data handling. Consider imputing missing values using Pandas or using statistical models that natively support missing values (e.g., linear mixed-effect models), though the latter are not implemented in Pingouin.","message":"Pingouin functions, especially those involving paired measurements (e.g., paired T-test, correlation, repeated measures ANOVA), automatically perform listwise deletion of missing values. This means entire rows with any missing data are removed, which can be drastic for datasets with many missing values.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to the latest version of Pingouin (0.6.0+) and re-run analyses if concerned about the accuracy of eta-squared values from older versions.","message":"The `pingouin.rm_anova` function had an issue in earlier versions (pre-0.6.0, specifically around March 2022 releases) where eta-squared (n2) effect size was incorrectly calculated and was identical to partial eta-squared. Users should double-check any effect sizes previously obtained with `rm_anova` from affected versions.","severity":"gotcha","affected_versions":"<0.6.0 (especially pre-March 2022)"},{"fix":"Ensure the outcome variable is continuous. For binary/ordinal outcomes or more advanced mediation models, consider alternative R packages like `lavaan` or `mediation`, or the PROCESS macro for SPSS.","message":"The `mediation_analysis` function currently only supports continuous outcome variables and does not work with binary or ordinal outcomes. Additionally, the p-value for the indirect effect should be interpreted with caution as it's computed using a bootstrap distribution and not strictly conditioned on a true null hypothesis.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'0.6.1':52 '3':13 'analysi':46,66 'anova':37 'base':15 'bay':40 'biostatist':71 'cadenc':60 'comprehens':24 'comput':68 'correl':38 'current':48 'data':65 'develop':63 'effect':42 'factor':41 'frequent':58 'friend':28 'function':31 'includ':36 'librari':55 'maintain':56 'most':16 'numpi':20,70 'ongo':62 'open':6 'open-sourc':5 'packag':9 'panda':18,69 'pingouin':1,2 'provid':22 'psycholog':72 'python':12 'regress':39 'releas':59 'reliabl':45 'scientif':67 'set':29 'size':43 'sourc':7 'stabl':49 'statist':8,34,64 'test':35 'user':27 'user-friend':26 'various':33 'version':50 'written':10 'yet':25","created_at":"2026-04-14T05:07:24.999660+00:00","updated_at":"2026-04-16T18:01:25.846298+00:00","problems":[{"fix":"Upgrade both `pingouin` and `scipy` to their latest compatible versions using `pip install --upgrade pingouin scipy` or `conda update pingouin scipy`. Pingouin 0.6.1 is compatible with NumPy >= 1.22.4 and SciPy >= 1.8.0.","cause":"This error arises due to compatibility issues between specific versions of `pingouin` and `scipy`, where `pingouin` attempts to import internal or private functions from `scipy` that may have been moved or renamed in newer `scipy` releases.","error":"ImportError: cannot import name '_unequal_var_ttest_denom' from 'scipy.stats.stats'"},{"fix":"Examine the data for the specific comparison where the error occurs. If all values are identical, the non-parametric test is not meaningful for that data. Consider if there's a data entry issue or if a different statistical approach is required, or simply acknowledge no difference exists.","cause":"This error occurs in non-parametric tests like the Wilcoxon signed-rank test (often called via `pairwise_ttests(parametric=False)`) when all pairwise differences between the two compared conditions are exactly zero, meaning there's no variability for the test to analyze.","error":"ValueError: zero_method 'wilcox' and 'pratt' do not work if x - y is zero for all elements."},{"fix":"Ensure that the input variables `x` and `y` are explicitly 1-dimensional NumPy arrays or Pandas Series. When extracting columns from a DataFrame, use `df['column_name']` or `df.column_name` to ensure a Series is returned.","cause":"The `pingouin.corr` function, and potentially other correlation functions, expects its input arrays `x` and `y` to be one-dimensional. This error is raised when multi-dimensional arrays or DataFrame slices that are not explicitly 1D Series are passed as arguments.","error":"AssertionError: x and y must be 1D array."},{"fix":"Before passing the DataFrame to `pingouin.mixed_anova`, convert the categorical columns used as factors to `object` (string) or numeric (int) dtype, for example: `df['column_name'] = df['column_name'].astype(str)`.","cause":"This specific `KeyError` can occur in `pingouin.mixed_anova` when one of the factor columns (`between`, `within`, or `subject`) is explicitly cast to a Pandas 'category' dtype. The function or its internal dependencies may not correctly process columns of this specific type.","error":"KeyError: 'Column not found: [column_name]'"},{"fix":"Verify that your dataset has enough non-missing values for the specified columns after any data cleaning or subsetting. This may require reviewing data quality, handling `NaN` values, or collecting more observations.","cause":"This error indicates that there are insufficient valid (non-missing) observations in the data provided to a Pingouin function, often `pg.intraclass_corr`, which requires a minimum number of data points (in this case, 5) to perform reliable calculations.","error":"AssertionError: Data must have at least 5 non-missing values"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.6.1","cli_name":"","cli_version":null,"type":"library","homepage":"https://pingouin-stats.org/index.html","github":"https://github.com/raphaelvallat/pingouin","docs":null,"changelog":"https://pingouin-stats.org/build/html/changelog.html","pypi":"https://pypi.org/project/pingouin/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-31","next_check":"2026-07-28","install_tag":null}}