diptest
Hartigan's diptest.
Decision gist · record as of 2026-08-14
Yes, if you need to test for unimodality in univariate samples. The package is actively maintained, has no known vulnerabilities, installs easily on modern Python versions via pre-built wheels, and implements a well-established statistical test. Copyleft licensing is a consideration only if you plan to redistribute modified code; using it as a library in a proprietary application is permissible. Medium install friction is negligible for most users thanks to wheel availability.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires numpy and psutil as runtime dependencies; Python >= 3.8.
- Medium install friction due to compiled C++ extension with optional OpenMP parallelization.
- Pre-built wheels are available for Python 3.8–3.14 on Windows, Linux, and macOS (both x86_64 and ARM64), so most users will install without compilation.
License · maintenance · safety
GPLv2+ (copyleft) — Licensed under GPLv2+, a copyleft license. Any derivative work or modification must be distributed under the same or compatible GPL terms; proprietary or closed-source projects incorporating this code must comply with GPL obligations.
last release 2026-04-24 (112 days) · last repo commit 2026-08-11 · 33 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 192,953 downloads/mo, #9,855 on PyPI
Alternatives
Verify before relying
import numpy as np
import diptest
x = np.random.normal(0, 1, 1000)
dip, pval = diptest.diptest(x)- Whether the package's performance characteristics (compute and memory intensity for N > 1e5) are acceptable for your typical sample sizes.
- Whether OpenMP bundling in pre-built wheels causes conflicts with other OpenMP-linked libraries in your environment.
What it is and what it does
diptest is a Python/C++ implementation of Hartigan & Hartigan's statistical test for unimodality. It computes a dip statistic that measures the maximum vertical distance between an empirical cumulative distribution function and the best-fitting unimodal distribution, making no assumptions about the null distribution's form beyond unimodality.
The package exposes two main functions: `dipstat` computes only the dip statistic, while `diptest` returns both the statistic and a p-value. P-values can be computed via interpolation of a critical value table (default, fast) or by bootstrapping the null hypothesis (slower but more accurate for non-standard cases). Bootstrapping supports optional OpenMP-based parallelization for speed.
Use it for
- Test whether a univariate sample is unimodal or contains multiple modes, useful in exploratory data analysis.
- Detect bimodality or multimodality in biological measurements, particle size distributions, or other empirical samples.
- Validate assumptions in statistical modeling pipelines that require unimodal data.
- Compare modality across groups or conditions by computing dip statistics for each sample.
- Perform hypothesis testing on the null hypothesis of unimodality without assuming a specific parametric form.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to test for unimodality in univariate samples.
The package is actively maintained, has no known vulnerabilities, installs easily on modern Python versions via pre-built wheels, and implements a well-established statistical test. Copyleft licensing is a consideration only if you plan to redistribute modified code; using it as a library in a proprietary application is permissible. Medium install friction is negligible for most users thanks to wheel availability.
Install
diptest on PyPI
Before you install
Medium install friction due to compiled C++ extension with optional OpenMP parallelization. Pre-built wheels are available for Python 3.8–3.14 on Windows, Linux, and macOS (both x86_64 and ARM64), so most users will install without compilation. Building from source requires a compatible C/C++ compiler.
Requires numpy and psutil as runtime dependencies; Python >= 3.8.
License in practice
Licensed under GPLv2+, a copyleft license. Any derivative work or modification must be distributed under the same or compatible GPL terms; proprietary or closed-source projects incorporating this code must comply with GPL obligations.
Quickstart
import numpy as np
import diptest
x = np.random.normal(0, 1, 1000)
dip, pval = diptest.diptest(x)
Verify before relying
- Whether the package's performance characteristics (compute and memory intensity for N > 1e5) are acceptable for your typical sample sizes.
- Whether OpenMP bundling in pre-built wheels causes conflicts with other OpenMP-linked libraries in your environment.
Package facts
| License | GPLv2+ copyleft |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 2 packagespsutilnumpy |
| Maintenance | Actively maintained 112 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 192,953 / month, #9,855 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: diptest-0.11.0-cp310-cp310-macosx_13_0_arm64.whl; diptest-0.11.0-cp310-cp310-macosx_13_0_x86_64.whl; diptest-0.11.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; diptest-0.11.0-cp310-cp310-win_amd64.whl; diptest-0.11.0-cp311-cp311-macosx_13_0_arm64.whl; diptest-0.11.0-cp311-cp311-macosx_13_0_x86_64.whl; diptest-0.11.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; diptest-0.11.0-cp311-cp311-win_amd64.whl; diptest-0.11.0-cp312-cp312-macosx_13_0_arm64.whl; diptest-0.11.0-cp312-cp312-macosx_13_0_x86_64.whl; diptest-0.11.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; diptest-0.11.0-cp312-cp312-win_amd64.whl; diptest-0.11.0-cp313-cp313-macosx_13_0_arm64.whl; diptest-0.11.0-cp313-cp313-macosx_13_0_x86_64.whl; diptest-0.11.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; diptest-0.11.0-cp313-cp313-win_amd64.whl; diptest-0.11.0-cp314-cp314-macosx_13_0_arm64.whl; diptest-0.11.0-cp314-cp314-macosx_13_0_x86_64.whl; diptest-0.11.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; diptest-0.11.0-cp314-cp314-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “dip test unimodality”
- diptestComputes Hartigan's dip test statistic and p-value to detect…
- litlit is a portable test runner for executing LLVM and Clang style test…
- ddtddt multiplies a single test case across multiple datasets, letting…
Give your agent the search over MCP, or paste the wish link into any chat.
More Mathematics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.
Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.
SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.
onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.
Install it if you have ONNX models to run in production or development.
See also powershap · hyppo · bootstrapped · pingouin · scikit-posthocs · krippendorff · lightgbm · moocore · empirical-calibration · dipy