Skip to main content

Probability Density Function calculator for Binmonial and Gaussian distributions

Project description

logo

Python module that calculates the probability density function, along with the median and standard deviation for numerical datasets exhibiting Gaussian or Binomial distributions.

Installation

pip install juan-stats

Demo in Google Colab

Look the package in action here

Features Gaussian Distribution

  • Read numerical datasets from a CSV file or a Python list
gaussian_one = Gaussian()
gaussian_one.read_data_file("numbers.csv")

#another option is to read the data from a list
gaussian_one.data = [10,10,10,19,15,15,12,12,2,9,8,8,5] 
  • Calculate the mean, standard deviation, and relative probability density at a specific point in a Gaussian distribution
print(gaussian_one.calculate_mean())
print(gaussian_one.calculate_stdev())
print(gaussian_one.pdf(49))
  • Plot Histogram of the data or the Normalized histogram along with the probability density function
gaussian_one.plot_histogram()
gaussian_one.plot_histogram_pdf()

Features Binomial Distribution

  • Calculate the mean, and standard deviation given some probability p and number of trials n
Binomial(0.4, 25)
#or
Binomial(p=0.4, n=25)
  • Read numerical datasets from a CSV file or a Python list. The dataset should be composed of 0 and 1.
  • Calculate the mean, standard deviation, and relative probability density at a specific point in a Binomial distribution
binomial_one.data = [0,1,0,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1] 
print(binomial_one.calculate_mean())
print(binomial_one.calculate_stdev())
print(binomial_one.pdf(5))
  • Plot the probability density function of the binomial distribution
binomial_one.plot_bar_pdf()

Contributing

Submit a pull request to this Github repository and add other distributions you may like!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

juan_stats-1.8.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file juan_stats-1.8.tar.gz.

File metadata

  • Download URL: juan_stats-1.8.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for juan_stats-1.8.tar.gz
Algorithm Hash digest
SHA256 b8adad18963b1bf1923f150c77a284fe9b313b31af96e6f858d3fa4ec3092bae
MD5 3024b9bcafb419fcfc57bd1d97a5371a
BLAKE2b-256 120fff29b8beab4ca6cdf3175a83f6d91fedd2c0c9536d8934fcb97fc71041b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page