All Projects → webermarcolivier → Statannot

webermarcolivier / Statannot

Licence: mit
add statistical annotations (pvalue significance) on an existing boxplot generated by seaborn boxplot

Projects that are alternatives of or similar to Statannot

Mydatascienceportfolio
Applying Data Science and Machine Learning to Solve Real World Business Problems
Stars: ✭ 227 (-0.44%)
Mutual labels:  jupyter-notebook
Nlp made easy
Explains nlp building blocks in a simple manner.
Stars: ✭ 232 (+1.75%)
Mutual labels:  jupyter-notebook
Stylegan2 Face Modificator
Simple Encoder, Generator and Face Modificator with StyleGAN2
Stars: ✭ 232 (+1.75%)
Mutual labels:  jupyter-notebook
Beakerx
Beaker Extensions for Jupyter Notebook
Stars: ✭ 2,594 (+1037.72%)
Mutual labels:  jupyter-notebook
Stat451 Machine Learning Fs20
STAT 451: Intro to Machine Learning @ UW-Madison (Fall 2020)
Stars: ✭ 230 (+0.88%)
Mutual labels:  jupyter-notebook
Machine Learning By Andrew Ng In Python
Documenting my python implementation of Andrew Ng's Machine Learning course
Stars: ✭ 231 (+1.32%)
Mutual labels:  jupyter-notebook
Movie Plots By Genre
Movie plots by genre tutorial at PyData Berlin 2016
Stars: ✭ 230 (+0.88%)
Mutual labels:  jupyter-notebook
Learn Statistical Learning Method
Implementation of Statistical Learning Method, Second Edition.《统计学习方法》第二版,算法实现。
Stars: ✭ 228 (+0%)
Mutual labels:  jupyter-notebook
Hamiltonian Nn
Code for our paper "Hamiltonian Neural Networks"
Stars: ✭ 229 (+0.44%)
Mutual labels:  jupyter-notebook
Installations mac ubuntu windows
Installations for Data Science. Anaconda, RStudio, Spark, TensorFlow, AWS (Amazon Web Services).
Stars: ✭ 231 (+1.32%)
Mutual labels:  jupyter-notebook
Quantiacs Python
Python version of Quantiacs toolbox and sample trading strategies
Stars: ✭ 230 (+0.88%)
Mutual labels:  jupyter-notebook
All Python Codes Of Ztm Course By Andrei Neagoie
Stars: ✭ 229 (+0.44%)
Mutual labels:  jupyter-notebook
Dagmm
My attempt at reproducing the paper Deep Autoencoding Gaussian Mixture Model for Unsupervised Anomaly Detection
Stars: ✭ 231 (+1.32%)
Mutual labels:  jupyter-notebook
Fusenet
Deep fusion project of deeply-fused nets, and the study on the connection to ensembling
Stars: ✭ 230 (+0.88%)
Mutual labels:  jupyter-notebook
Introduction To Python
Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readability with its notable use of significant white space. (This repository contains Python 3 Code)
Stars: ✭ 232 (+1.75%)
Mutual labels:  jupyter-notebook
Comp Genomics Class
Code and examples for JHU Computational Genomics class
Stars: ✭ 228 (+0%)
Mutual labels:  jupyter-notebook
Neural Network From Scratch
Ever wondered how to code your Neural Network using NumPy, with no frameworks involved?
Stars: ✭ 230 (+0.88%)
Mutual labels:  jupyter-notebook
Wassdistance
Approximating Wasserstein distances with PyTorch
Stars: ✭ 229 (+0.44%)
Mutual labels:  jupyter-notebook
Aotodata
朱小五写文章涉及到的数据分析,爬虫,源数据
Stars: ✭ 232 (+1.75%)
Mutual labels:  jupyter-notebook
Imaginary Numbers Are Real
Code To Accompany YouTube Series Imaginary Numbers Are Real
Stars: ✭ 231 (+1.32%)
Mutual labels:  jupyter-notebook

What is it

Python package to optionnally compute statistical test and add statistical annotations on an existing boxplot/barplot generated by seaborn.

Features

  • Single function to add statistical annotations on an existing boxplot/barplot generated by seaborn boxplot.
  • Integrated statistical tests (binding to scipy.stats methods):
    • Mann-Whitney
    • t-test (independent and paired)
    • Welch's t-test
    • Levene test
    • Wilcoxon test
    • Kruskal-Wallis test
  • Smart layout of multiple annotations with correct y offsets.
  • Annotations can be located inside or outside the plot.
  • Format of the statistical test annotation can be customized: star annotation, simplified p-value, or explicit p-value.
  • Optionally, custom p-values can be given as input. In this case, no statistical test is performed.

Installation

The latest stable release can be installed from PyPI:

pip install statannot

You may instead want to use the development version from Github:

pip install git+https://github.com/webermarcolivier/statannot.git

Documentation

See example jupyter notebook example/example.ipynb.

Usage

Here is a minimal example:

import seaborn as sns
from statannot import add_stat_annotation

df = sns.load_dataset("tips")
x = "day"
y = "total_bill"
order = ['Sun', 'Thur', 'Fri', 'Sat']
ax = sns.boxplot(data=df, x=x, y=y, order=order)
test_results = add_stat_annotation(ax, data=df, x=x, y=y, order=order,
                                   box_pairs=[("Thur", "Fri"), ("Thur", "Sat"), ("Fri", "Sun")],
                                   test='Mann-Whitney', text_format='star',
                                   loc='outside', verbose=2)
test_results

More examples are available in the jupyter notebook example/example.ipynb.

Examples

Example 1

Example 2

Requirements

  • Python >= 3.5
  • numpy >= 1.12.1
  • seaborn >= 0.8.1
  • matplotlib >= 2.2.2
  • pandas >= 0.23.0
  • scipy >= 1.1.0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].