statistical distributions
Project description
# distributions package
The package contains modules that can be used to create Binomial and Gaussian distribution objects and perform operations on them.
# Files
Binomialdistribution.py: Contains the Binomial class that can be used to create binomial distribution objects, given the number of trials and the probablity of an event occuring, or by reading in data from a data file.
Gaussiandistribution.py: Contains the Gaussian class that can be used to create gaussian distribution objects, which can be initialized providing the distribution’s mean and standard deviation or reading in data from a file.
Generaldistribution.py: Contains the Distribution class, with common dsitribution attributes and methods. Inherited by both, Binomial and Gaussian classes.
# Installation
pip install such-distribution
# Usage Example
>>> from distributions import * >>> Binomial(0.3, 10) mean 3.0, standard deviation 1.4491376746189437, p 0.3, n 10 >>> Gaussian(10, 80) mean 10, standard deviation 80 >>> bd1 = Binomial(0.4, 20) >>> bd2 = Binomial(0.4, 30) >>> bd1 + bd2 mean 20.0, standard deviation 3.4641016151377544, p 0.4, n 50 >>> gd1 = Gaussian(8, 20) >>> gd2 = Gaussian(7, 30) >>> gd1 + gd2 mean 15, standard deviation 36.05551275463989
## Read line separated values from a file
>>> gd1.read_data_file('/home/numbers.txt')
>>> gd1.calculate_mean()
78.0909090909091
>>> gd1.calculate_stdev()
92.87459776004906
>>> bd1.read_data_file('/home/numbers_binomial.txt')
>>> bd1.replace_stats_with_data()
(0.6153846153846154, 13)
>>> bd1.mean
8.0
>>> bd1.stdev
1.7541160386140584
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
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 such-distribution-2.0.tar.gz.
File metadata
- Download URL: such-distribution-2.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5021c09d0582a9461663160bdc8ab0e3342c171887e41838a4e2dae1a4686af
|
|
| MD5 |
47a9648172d13c29db461bd2eb3091f1
|
|
| BLAKE2b-256 |
fbeb0d9214bf0df509b1be76b1a209b015a582fdb49b71d77270270e7ae9cb51
|
File details
Details for the file such_distribution-2.0-py3-none-any.whl.
File metadata
- Download URL: such_distribution-2.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26f6a759378db6b8875abf3af1b1de2325ec915c404534c6e948abdd13397d3d
|
|
| MD5 |
a4917f18224f0e11b8cffa14bda7ada0
|
|
| BLAKE2b-256 |
387ac4a5c55e23857ceab9c5589e5251369d517e704d31024ce853628f3ed885
|