On this page
Key takeaways
- Python has mature libraries for running and reporting statistical tests.
- SciPy covers the core tests such as t-tests and chi-square.
- statsmodels adds regression and detailed summary tables.
- pingouin keeps the output tidy and adds effect sizes.
- JASP, jamovi and the R Project offer point and click or full language options, and PyMC handles Bayesian models.
Why run statistical tests in Python
A statistical test turns a question into a number that can be checked, such as whether two groups really differ or whether two measures move together. Running it in Python keeps the test next to the data loading and charting code, so the whole analysis lives in one place.
The ecosystem ranges from single test functions to full modeling frameworks and graphical tools. The list below covers the options a data team reaches for most often, whether it prefers code or a menu.
Quick comparison
| Tool | Best for | Starting price | Free plan |
|---|---|---|---|
| SciPy | Core hypothesis tests | Not included | Not included |
| statsmodels | Models and summary tables | Not included | Not included |
| pingouin | Simple tests and effect sizes | Not included | Not included |
| JASP | Point and click analysis | Not included | Not included |
| jamovi | Spreadsheet style stats | Not included | Not included |
| R Project | Full statistical language | Not included | Not included |
| PyMC | Bayesian modeling | Not included | Not included |
The best tools for running statistical tests in Python
1. SciPy
- Official site: https://scipy.org/
- Best for: Core hypothesis tests
- Starting price: Not included
- Free plan: Not included
- Pros: Wide test coverage; short calls
- Cons: Low level output; manual reporting
SciPy's stats module holds the core hypothesis tests many analyses need. It covers t-tests, chi-square, Mann-Whitney and many others, and it returns the test statistic along with a p-value, all with a short function call.
Because SciPy is a general scientific library, it also provides distributions, sampling and optimization that surround the tests. Teams use it when they want a direct, low level test inside a larger Python script. It also underpins many higher level tools, so knowing it helps when a result needs to be checked by hand.
2. statsmodels
- Official site: https://www.statsmodels.org/
- Best for: Models and summary tables
- Starting price: Not included
- Free plan: Not included
- Pros: Detailed summaries; pandas friendly
- Cons: Verbose output; steeper API
statsmodels focuses on statistical models with the detailed output researchers expect. It fits linear and logistic regression, ANOVA and other models, then prints summary tables with coefficients, standard errors and confidence intervals.
The library pairs well with pandas and is a common choice when a team needs the full model output rather than a single test result. Its summary format reads like the tables from a statistics textbook, which makes results easier to share.
3. pingouin
- Official site: https://pingouin-stats.org/
- Best for: Simple tests and effect sizes
- Starting price: Not included
- Free plan: Not included
- Pros: Tidy DataFrames; effect sizes included
- Cons: Fewer models; smaller community
pingouin wraps common statistical tests in a simple API that returns pandas DataFrames. It adds effect sizes and other useful output to the usual p-values, so a team gets a tidy table instead of a raw number.
It is built for readable, repeatable analyses with less boilerplate. For researchers who want a t-test, ANOVA or correlation with the extra measures already computed, pingouin keeps the code short and the results consistent. The returned table is ready to drop into a report or a notebook without reformatting.
4. JASP
- Official site: https://jasp-stats.org/
- Best for: Point and click analysis
- Starting price: Not included
- Free plan: Not included
- Pros: Live results; no code needed
- Cons: Desktop app; less scriptable
JASP is a free desktop statistics program with a point and click interface. A team opens a data file, picks a test from a menu and sees the results update live, with tables and plots produced automatically.
It runs on the R engine under the hood, so the methods are the same ones used in code, but without writing scripts. JASP suits people who prefer a graphical workflow while still getting proper statistical output.
5. jamovi
- Official site: https://www.jamovi.org/
- Best for: Spreadsheet style stats
- Starting price: Not included
- Free plan: Not included
- Pros: Familiar grid layout; menu driven
- Cons: Desktop app; fewer advanced models
jamovi is a free statistics application with a spreadsheet style layout. Data sits in a familiar grid, and analyses are added through a menu, with results appearing beside the data as they run.
It also builds on R, which means the calculations are established rather than reinvented. jamovi is a good fit for teaching and for quick analyses where a full programming environment feels like too much. Its results mirror R output, so a check done in the app can be reproduced in code later.
6. R Project
- Official site: https://www.r-project.org/
- Best for: Full statistical language
- Starting price: Not included
- Free plan: Not included
- Pros: Huge package library; research standard
- Cons: Separate language; different tooling
The R Project is a full language and environment for statistics. It has thousands of packages for tests, models and graphics, and it is the source of many methods that Python tools reimplement or call.
R is not Python, but it belongs on the list because it covers the widest range of statistical methods and remains a standard in research. Teams sometimes use both, running R for specialized tests and Python for the surrounding pipeline.
7. PyMC
- Official site: https://www.pymc.io/
- Best for: Bayesian modeling
- Starting price: Not included
- Free plan: Not included
- Pros: Full distributions; flexible models
- Cons: Steeper learning; slower runs
PyMC is a library for Bayesian modeling and probabilistic inference. Instead of a single p-value, it lets a team define a model, sample from the posterior and report full distributions for each parameter.
It suits questions that need uncertainty stated directly, such as estimating a rate with a credible interval. PyMC is heavier to learn than a single test, but it opens a different and flexible way to answer the same questions. The sampling step can be slow, but the full posterior is often worth the wait.
How we chose
The list pairs Python libraries with the graphical tools and language that many analysts also use. SciPy, statsmodels, pingouin and PyMC live inside Python, while JASP, jamovi and the R Project cover point and click and full language workflows.
Preference went to tools that are established, free to use and produce output a team can explain. The right pick depends on whether the analysis is a script, a model or a quick check with a menu.
FAQ
Can I run statistical tests entirely in Python?
Yes. SciPy, statsmodels and pingouin cover most common tests, and PyMC adds Bayesian modeling, all without leaving Python.
What is the difference between SciPy and statsmodels?
SciPy gives compact test results, while statsmodels fits fuller models and prints detailed summary tables with coefficients and intervals.
Do I need to know R to use JASP or jamovi?
No. Both are point and click programs that run on R underneath, so you get the methods without writing R code.
What are effect sizes?
They measure how large an observed difference is, separate from whether it is statistically significant. pingouin includes them by default.
When should I use PyMC?
Use PyMC when you want full uncertainty as distributions rather than a single p-value, such as for Bayesian models and credible intervals.
Can these tools share one workflow?
Yes. A team often runs a quick test in SciPy or pingouin, fits a model in statsmodels and reports through JASP or jamovi, keeping the numbers consistent across steps.