Registry / data / statannot

statannot

JSON →
library0.2.3pypypiunverified

A Python library to add statistical annotations (e.g., p-value brackets) on existing boxplots/barplots generated by seaborn. Current version 0.2.3, supports Python >=3.5. Maintenance mode; last release in 2020.

pip install statannot
INSTALL
IMPORT
SIG · STATANNOT
S
statannot
datapythonv0.2.3
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.3 · 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
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

statannot
from statannot import add_stat_annotation
import statannot
Direct import of the module does not expose the main function; use explicit import of add_stat_annotation.

Add statistical annotation (p-value brackets) to a seaborn boxplot.

import seaborn as sns import matplotlib.pyplot as plt from statannot import add_stat_annotation df = sns.load_dataset("tips") ax = sns.boxplot(x="day", y="total_bill", data=df) add_stat_annotation(ax, data=df, x="day", y="total_bill", test='t-test_ind', comparisons_correction=None, box_pairs=[("Thur", "Fri"), ("Thur", "Sat")], text_format='star', verbose=0) plt.show()
Debug
Known issues
deprecatedLibrary is in maintenance mode, no updates since 2020. Consider using statannotations (note the 's' at the end) which is actively maintained.
fix
Switch to statannotations: pip install statannotations, import from statannotations.
affects: >=0.2.0
gotchaThe 'box_pairs' parameter requires tuples of category names (strings) exactly as they appear in the data. Mismatched case or whitespace will silently produce no annotations.
fix
Ensure exact string matching of category names; use df['column'].unique() to verify.
affects: all
breakingAs of v0.2.0, the API changed: 'text_format' replaced 'pvalue_format' and 'verbose' parameter was added. If upgrading from <0.2.0, update function calls.
fix
Replace pvalue_format='star' with text_format='star'.
affects: >=0.2.0
gotchaThe 'test' parameter is case-sensitive. 't-test_ind' works, 't-test' does not. Incorrect values raise ValueError without a clear message.
fix
Use one of the supported tests: 't-test_ind', 't-test_paired', 'Mann-Whitney', 'Mann-Whitney-gt', 'Mann-Whitney-ls', 'Wilcoxon', 'Kruskal', 'ANOVA', 'Kruskal_Dunn'.
affects: all
gotchaThe 'comparisons_correction' parameter only accepts None or 'Bonferroni'. Using any other string will not raise an error but will be ignored.
fix
Use comparisons_correction=None or 'Bonferroni' only.
affects: >=0.2.3
Upgrade
Version history
0.2.3latest on PyPI · released Feb 25, 2020
Audit
Dependencies
seabornrequiredRequired for plotting, statannot operates on seaborn axes
matplotlibrequiredRequired for plotting and annotation rendering
scipyrequiredRequired for statistical tests
pandasrequiredRequired for data handling
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
statannot — pip install statannot · libregistry