Registry / data / pingouin

pingouin

JSON →
library0.6.1pypypi✓ verified 22d ago

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.

pip install pingouin
INSTALL
IMPORT
SIG · PINGOUIN
P
pingouin
datapythonv0.6.1
Install
23.0s avg
Import
5876ms
Disk
525MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 23.0s · import 5.876s · 508MB
525MB installed
● package 525MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pingouin
import pingouin as pg
Standard import for accessing all Pingouin functions.
ttest
from pingouin import ttest
Import specific functions directly to avoid namespace pollution if only a few functions are needed.

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.

import pingouin as pg import numpy as np import pandas as pd # Simulate two independent groups of data np.random.seed(123) data_group1 = np.random.normal(loc=10, scale=2, size=30) data_group2 = np.random.normal(loc=12, scale=2.5, size=30) # Perform an independent samples t-test result = pg.ttest(data_group1, data_group2, correction='auto') print(result) # Example with a DataFrame for ANOVA df_anova = pd.DataFrame({ 'dv': [10, 12, 11, 13, 15, 14, 16, 18, 17, 19, 20, 22], 'group': ['A']*4 + ['B']*4 + ['C']*4 }) aov_result = pg.anova(data=df_anova, dv='dv', between='group') print("\nANOVA Result:") print(aov_result)
Debug
Known issues
breakingThe `plot_shift` function was removed in Pingouin 0.6.0. Any code relying on this function will break.
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.
affects: >=0.6.0
breakingThe 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.
fix
Upgrade SciPy to at least version 1.10.0: `pip install --upgrade scipy`.
affects: >=0.6.0
deprecatedThe `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.
fix
Replace `pg.gzscore()` with `scipy.stats.gzscore()`.
affects: >=0.5.0
gotchaPingouin 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.
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.
affects: All versions
gotchaThe `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.
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.
affects: <0.6.0 (especially pre-March 2022)
gotchaThe `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.
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.
affects: All versions
Errors
Common errors & fixes
ImportError: cannot import name '_unequal_var_ttest_denom' from 'scipy.stats.stats'
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.
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.
ValueError: zero_method 'wilcox' and 'pratt' do not work if x - y is zero for all elements.
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.
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.
AssertionError: x and y must be 1D array.
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.
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.
KeyError: 'Column not found: [column_name]'
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.
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)`.
AssertionError: Data must have at least 5 non-missing values
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.
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.
Upgrade
Version history
0.6.1latest on PyPI · released Mar 28, 2026
Audit
Dependencies
numpyrequiredCore numerical operations.
scipyrequiredUnderlying statistical functions.
pandasrequiredData manipulation and DataFrame output for results.
pandas_flavorrequiredEnhances Pandas integration.
statsmodelsrequiredAdvanced statistical modeling.
matplotlibrequiredPlotting capabilities.
seabornrequiredEnhanced data visualization.
scikit-learnrequiredMachine learning utilities, e.g., for regression.
tabulaterequiredFormatting tabular data.
mpmathoptionalAdditional functionality for some functions, optional.
Agent activity
5 hits · last 30 days
node
4
Resources