A Python helper library for generating Process Behaviour Charts
Project description
statprocon
statprocon is a Python helper library for generating data for use in Statistical Process Control charts. SPC charts are also known as Process Behaviour Charts, Control charts or Shewhart charts.
Installation
pip install statprocon
Usage
from statprocon import XmR
counts = [10, 50, 40, 30]
xmr = XmR(counts)
moving_ranges = xmr.moving_ranges()
unpl = xmr.upper_natural_process_limit()
lnpl = xmr.lower_natural_process_limit()
x_bar = xmr.x_average()
url = xmr.upper_range_limit()
mr_bar = xmr.mr_average()
Currently, this library only supports the data for generating an XmR chart. An XmR chart is the simplest type of process behaviour chart. XmR is short for individual values (X) and a moving range (mR). More chart data options can be added via pull requests.
For more information, please read Making Sense of Data by Donald Wheeler.
CSV
Quickly generate a CSV of all the data needed to create XmR charts.
print(xmr.to_csv())
Google Sheets Charts
Quickly generate XmR Charts in Google Sheets
- Make a copy of the statprocon XmR Template sheet
- Paste the CSV output from above into cell A1
- Click
Data -> Split Text to Columns
The X and MR charts will appear on the right.
Note that the Lower Natural Process Limit may not make sense if your count data could not possibly go negative. If LNPL is not needed remove it by:
- Double click on the X Chart
- Click the
Setup
tab - Under
Series
, findLNPL
- Click the 3 dot menu on the right next to
LNPL
- Click
Remove
The LNPL line will be removed from the X Chart.
Dependencies
There are a few other Python libraries for generating SPC charts but they all contain large dependencies in order to include the ability to graph the chart. This package will remain small and light and not require large dependencies. The user will need to convert the data into charts on their own.
This package also contains extensive tests for verifying the integrity of the calculated data.
Development
Create virtualenv
python3 -m venv venv
Activate virtualenv
source venv/bin/activate
python -m build
python -m twine upload dist/*
Testing
python3 -m pip install .
Run tests
python3 -m unittest discover
Project details
Release history Release notifications | RSS feed
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
Hashes for statprocon-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16b1ba897f55b291820053d6d2c68889064cff81f5041e3c4ab5a73dc03cd65b |
|
MD5 | 6f6c9a54d7899bb4a72004ea0a88ccb0 |
|
BLAKE2b-256 | 3b8bfa469b585cbc11c7d21177710f7805c793f0f4d0640f71e2704335ea66ea |