This is a statistical Python library, to compute Mean and Standard deviation on of various Probability distributions, like Gaussian Distribution and Binomial distribution. This package is developed by Sandip Palit.
Install statement: pip install sp_distributions
Gaussian: from sp_distributions import Gaussian
Binomial: from sp_distributions import Binomial
Gaussian: g=Gaussian(5,3) (mu=5, sigma=3)
Binomial: b=Binomial(0.5,3) (p=0.5, n=3)
calculate_mean()
Function to calculate the mean of the data set.
Args: None
Returns: float
calculate_stdev()
Function to calculate the standard deviation of the data set.
Args: None
Returns: float
read_data_file()
Function to read in data from a txt file. The txt file should have one number (float) per line. After reading in the file, the mean and standard deviation are calculated
Args: file_name (string)
Returns: None
plot()
Function to output a plotting of the instance variable data using matplotlib pyplot library.
Args: None
Returns: None
pdf():
Probability density function calculator for the gaussian distribution, on a specific point (x).
Args: x (float)
Returns: float
plot_pdf():
Function to plot the normalized graph of the data and a plot of the probability density function along the same range.
Args: n_spaces (int)
Returns: x values (list), y values (list)
You can also add together two objects of a distribution by using + operator.