uncertainties
calculations with values with uncertainties, error propagation
What it is and what it does
The uncertainties package lets you perform calculations on numbers that have measurement errors or uncertainties attached to them, automatically computing how those errors propagate through your math. Instead of manually tracking error bars at each step, you work with uncertain values directly—operations like addition, multiplication, and trigonometric functions all handle error propagation transparently. The package correctly accounts for correlations, so expressions like x - x evaluate to exactly zero rather than showing spurious uncertainty.
It supports most standard mathematical operations including functions from the math module, comparison operators, and array operations through a NumPy-like interface. You can also extract derivatives of any expression automatically, which the package uses internally for error propagation but exposes for your own use. The package is designed to require minimal changes to existing code—you typically just replace float literals with uncertain values and the rest works as expected.
Use it for:
- Physics or chemistry experiments: track measurement uncertainties through multi-step calculations and report final results with error bars
- Engineering design: propagate component tolerances through system models to predict overall system uncertainty
- Data analysis: compute statistics on datasets where each point has an associated measurement error
- Educational demonstrations: show students how errors accumulate through calculations without manual error propagation formulas
- Calibration and metrology: combine multiple uncertain measurements and track how uncertainty changes through transformations
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Performs arithmetic and mathematical operations on values with uncertainties, automatically propagating errors through calculations and tracking correlations between expressions.
Yes. The package is actively maintained, has no dependencies, installs easily, carries no security vulnerabilities, and solves a genuine problem in scientific and engineering workflows. It's production-stable (since 2010) and widely used. Install it if you work with measurements or experimental data where uncertainty quantification matters.
Install
uncertainties on PyPI
pip
pip install uncertaintiesuv
uv add uncertaintiespoetry
poetry add uncertaintiesInstalling uncertainties
Before you install
Low friction installation with no runtime dependencies. Active maintenance status with recent commits and a stable release history since 2010.
License in practice
Released under the Revised BSD License (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install uncertainties
from uncertainties import ufloat
x = ufloat(2, 0.25)
square = x**2
print(square) # 4.0+/-1.0
print(square.nominal_value, square.std_dev)
Verify before relying
- Whether the package supports symbolic uncertainty propagation or only numerical methods
- Performance characteristics when working with very large arrays or matrices of uncertain values
Package facts
| License | Revised BSD License (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 480 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,595,858/month — #2,976 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: uncertainties-3.2.3-py3-none-any.whl
Keywords: error propagation, uncertainties, uncertainty calculations, standard deviation, derivatives, partial derivatives, differentiation
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
sigfigRounds numbers by significant figures, decimal…
permissive · top 5,000 on PyPI
numdifftoolsComputes numerical derivatives, gradients,…
permissive · top 15,000 on PyPI
math-verifyEvaluates mathematical expressions from LLM…
permissive · top 5,000 on PyPI
PintPint defines, operates on, and converts between…
permissive · top 5,000 on PyPI
lmfitLmfit provides non-linear least-squares…
permissive · top 5,000 on PyPI
MAPIEMAPIE computes prediction intervals and…
permissive · top 15,000 on PyPI
autogradAutograd automatically computes derivatives of…
permissive · top 5,000 on PyPI
autograd-gammaProvides autograd-compatible derivatives for…
permissive · top 5,000 on PyPI
statisticsProvides basic mathematical statistics…
permissive · top 15,000 on PyPI
riskfolio-libRiskfolio-Lib builds optimized investment…
permissive · top 15,000 on PyPI