Measurement statistics with uncertainties and error propagation
Project description
A statistical package for measurement and population statistics that incorporate measurement uncertainties and error propagation.
Installation:
pip install measurement_stats
Error Propagation
Say, for example, that we have measured a rectangle to be 11 +/- 0.4 centimeters wide and 8 +/- 0.3 centimeters long. We can then calculate the area with uncertainty as follows:
from measurement_stats import ValueUncertainty width = ValueUncertainty(11, 0.4) length = ValueUncertainty(8, 0.3) area = length * width print('AREA:', area.label) # $ AREA: 88 +/- 5
For a more complicated example, consider the canonical physics 101 experiment of trying to calculate the acceleration due to gravity using a pendulum. If a student has setup a pendulum with a measured length of 92.95 centimeters and an uncertainty of 0.1 centimeters and measured a period of that pendulum to be 1.936 seconds with an uncertainty of 0.004 seconds, the acceleration due to gravity, with propagated uncertainty, can be determined as follows:
from measurement_stats import ValueUncertainty l = ValueUncertainty(92.95, 0.1) T = ValueUncertainty(1.936, 0.004) g = 4.0 * (math.pi ** 2) * l / (T ** 2) print('Acceleration Due To Gravity:', g.label) # $ Acceleration Due To Gravity: 979 +/- 4
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file measurement_stats-0.3.0.tar.gz
.
File metadata
- Download URL: measurement_stats-0.3.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96b1d231755a6ffd8cf3c48a3d10bd74a230b815f6fa77bd624209614c4a4237 |
|
MD5 | 7431804187ebbe875d0fe1b0004ea2c3 |
|
BLAKE2b-256 | 23c47885dc811a126d95360270990571d538a1fa847f12283c85033e8fb693ad |
File details
Details for the file measurement_stats-0.3.0-py2.py3-none-any.whl
.
File metadata
- Download URL: measurement_stats-0.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a8119307f542660f929fef7af72a925c496e400b93f5f0b1e2cb287990a78e5 |
|
MD5 | b899b904b51a661053a748c8cbf9e34f |
|
BLAKE2b-256 | 21105bd2ae34ef87208b8e2c5301cae203a72ad3677c550253cde3b7e9a2e3fe |