Skip to main content

aac-distributions package

This package provides the Gaussian 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) - 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 of the Binomial distribution from p and n.
    
	calculate_stdev() - Function to calculate the standard deviation of the Binomial distribution 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 bar chart of the instance variable data using 
    matplotlib pyplot library.
    
	pdf(k) - Probability density function calculator for the binomial distribution.
        Args:
            x (float): point for calculating the probability density function
        Returns:
            float: probability density function output
        
	plot_bar_pdf() - Function that creates the bar chart that plots 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.

  • Distribution - Generic distribution class for calculating and visualizing a probability distribution, from which Gaussian and Binary distributions inherit

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.

Methods:

	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.

Files

  • Generaldistribution.py -> contains the Distribution class, its attributes and methods being inherited by Gaussian and Binomial class.
  • Gaussiandistribution.py -> contains the Gaussian class, its attributes and methods as described in aac-distributions package summary.
  • Binomialdistribution.py -> contains the Binomial class, its attributes and methods as described in aac-distributions package summary.

Installation

  • Note: In init.py, notice that there's is a dot in front of the .py files when importing the Gaussian and Binomial classes.

  • This dot is required in Python 3.X, but if you are working in Python 2.X, you shouldn't need it.

  • The classes in this package make use of built-in Python libraries like: Math - provides access to mathematical functions matplotlib - provides data visualization and graphical plotting functionality

  • To install the package, type pip install aac-distributions

Metadata

Release files for aac-distributions 0.7

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

Source distribution (sdist)

Source distribution for aac-distributions 0.7
File Size Uploaded Provenance
aac_distributions-0.7.tar.gz 5.5 kB Without provenance Details

Release files / aac_distributions-0.7.tar.gz

Download URL aac_distributions-0.7.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4910c972de75a84cb756299845ba6c5bf007198a14381b2331669e9b7b4c9f47
BLAKE2b-256 checksum
How to use checksums
d210a703cd35b9a2f6faaa89a92204b8f9f62fe0af471c58c101028e65f805cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/3.7.0 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.3

Security for aac-distributions 0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7 This release

1 release file No provenance

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