Skip to main content

Project description

Jashu-prob-distributions package

This package provides the Gaussian distribution and Binomial distribution classes.

  • Gaussian - Gaussian distribution class for calculating and visualizing a Gaussian distribution. Attributes: mean (float) - representing the mean value of the distribution. stdev (float) - representing the standard deviation of the distribution. data_list (list of floats) - a list of floats extracted from the data file.

Methods: calculate_mean() - Function to calculate the mean of the data set.

calculate_stdev() - Function to calculate the standard deviation of the data set.

plot_histogram() - Function to output a histogram of the instance variable data using matplotlib pyplot library.

read_data_file(filename) - Function to read in data from a txt file. The txt file should have one number (float) per line. The numbers are stored in the data attribute.

pdf(x) - Probability density function calculator for the gaussian distribution Args: x (float): point for calculating the probability density function Returns: float: probability density function output

plot_histogram_pdf(n_spaces = 50) - Function to plot the normalized histogram of the data and a plot of the probability density function along the same range Args: n_spaces (int): number of data points Returns: list: x values for the pdf plot list: y values for the pdf plot

add(other) - Function to add together two Gaussian distributions Args: other (Gaussian): Gaussian instance Returns: Gaussian: Gaussian distribution

repr() - Function to output the characteristics of the Gaussian instance

  • Binomial - Binomial distribution class for calculating and visualizing a Binomial distribution. Attributes: mean (float) representing the mean value of the distribution stdev (float) representing the standard deviation of the distribution data_list (list of floats) a list of floats to be extracted from the data file p (float) representing the probability of an event occurring n (int) number of trials

Methods: calculate_mean() - Function to calculate the mean from p and n

calculate_stdev() - Function to calculate the standard deviation from p and n.

read_data_file(filename) - Function to read in data from a txt file. The txt file should have one number (float) per line. The numbers are stored in the data attribute.

replace_stats_with_data() - Function to calculate p and n from the data set Args: None Returns: float: the p value float: the n value

plot_bar() - Function to output a histogram of the instance variable data using matplotlib pyplot library.

pdf(k) - Probability density function calculator for the gaussian distribution. Args: x (float): point for calculating the probability density function Returns: float: probability density function output

plot_bar_pdf() - Function to plot the pdf of the binomial distribution Args: None Returns: list: x values for the pdf plot list: y values for the pdf plot

add(other) - Function to add together two Binomial distributions with equal p Args: other (Binomial): Binomial instance Returns: Binomial: Binomial distribution

repr() - Function to output the characteristics of the Binomial instance.

Files

  • Generaldistribution.py - contains Distribution class, its attributes and methods being inherited by Gaussian and Binomial class.
  • Gaussiandistribution.py - contains Gaussian class, its attributes and methods stated above in Jashwanth-prob-distributions package summary.
  • Binomialdistribution.py - contains Binomial class, its attributes and methods stated above in Jashwanth-prob-distributions packagesummary.

Installation

  • The code should run with no issues using Python versions 3.*.
  • No extra besides the built-in libraries from Anaconda needed to run this project Math matplotlib

Use the package manager pip to install jashu_prob_distributions.

pip install Jashu-prob-distributions

open python IDE, Try Usage,

from jashu_prob_distributions import Gaussian, Binomial

Gaussian(10, 7) #returns a Gaussian Distribution with mean and standard deviation

Binomial(.4,25) #returns a Binomial distribution with mean ,standard deviation,p,n

Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

Release files for Jashu-prob-distributions 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Jashu-prob-distributions 1.0.4
File Size Uploaded
Jashu-prob-distributions-1.0.4.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Jashu-prob-distributions 1.0.4
File Interpreter ABI Platform
Jashu_prob_distributions-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / Jashu-prob-distributions-1.0.4.tar.gz

Download URL Jashu-prob-distributions-1.0.4.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5dcd0a60e6cee4098021e9c5beb225abef63a7654efd9b02c082b04c99dd3b7b
BLAKE2b-256 checksum
How to use checksums
0b6d2f873ee6cd2f18cbab93145d260d7d62c49157fa9d33afd8fc1fdf730af8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / Jashu_prob_distributions-1.0.4-py3-none-any.whl

Download URL Jashu_prob_distributions-1.0.4-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
641323e39d3ae7c7357792819958f51b764fa1849d7c6fae97523a9d47e470ee
BLAKE2b-256 checksum
How to use checksums
72356234215f8065d5c3239e997c2dc885029b76e705e62b03b7c302170c2648
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page