Transparent calculations with uncertainties on the quantities involved (aka "error propagation"); calculation of derivatives.
Clone or download
lebigot Merge pull request #90 from baldyeagle/patch-1
PyPI badge added to README
Latest commit 0c15978 Oct 30, 2018



This is the uncertainties Python package, which performs transparent calculations with uncertainties (aka "error propagation"):

>>> from uncertainties import ufloat
>>> from uncertainties.umath import *  # sin(), etc.
>>> x = ufloat(1, 0.1)  # x = 1+/-0.1
>>> print 2*x
>>> sin(2*x)  # In a Python shell, "print" is optional

This package also automatically calculates derivatives:

>>> (2*x+1000).derivatives[x]

Some useful links:


The release branch is the latest stable release for Python 2.7+ (including Python 3+ through 2to3), while the release_python2.3 branch is the same but for Python 2.3 to 2.6 (with unit tests only run with Python 2.6). They should pass the tests.

master* branches in the Github repository are bleeding-edge, and do not necessarily pass the tests. The master and master_python2.3 are the latest, relatively stable versions (while other master* branches are more experimental).

Other branches might be present in the GitHub repository, but they are also temporary and represent work in progress that does not necessarily run properly yet.


This package and its documentation are released under the Revised BSD License.