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 value
width = value.ValueUncertainty(11, 0.4)
length = value.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:
l = value.ValueUncertainty(92.95, 0.1)
T = value.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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file measurement_stats-0.1.2.tar.gz.
File metadata
- Download URL: measurement_stats-0.1.2.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
301c16161cbb742b48b7e2bb7e991da83ae6efe7fd6d54a40bcb332b34090dbc
|
|
| MD5 |
d9259b96f1df7eb4dfc2bc125b457351
|
|
| BLAKE2b-256 |
96cc256fd8d5ae734e29070677e489968bc69467b527af1abacb119c0e8f31ad
|
File details
Details for the file measurement_stats-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: measurement_stats-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26d1d1185b9a05cb155729941ba835db6d8f9ef553e67d90d3198bf7e6356f18
|
|
| MD5 |
a9eea1e054485972e75404aeabe31110
|
|
| BLAKE2b-256 |
acc4c5dfa28c13bb151539188d679022ec17d194ad6e92ee28a069d43681b411
|