Skip to main content

Various Functions and Methods for sample distributions

Project description

kavanaghdistributions

kavanaghdistributions is a python package for generating samples from Normal, Poisson and Binomial Distributions.

Installation

Use the package manager pip to install kavanaghdistributions.

pip install kavanaghdistributions

Usage

from kavanaghdistributions.functions import random_draw
from kavanaghdistributions.classes import NormalDistribution, PoissonDistribution, BinomialDistribution

#random_draw function 

random_draw(sample_shape=5, distribution='normal', mean=1, sd=2)
# generates: array([1.82261281, 0.81926903, 3.06892213, 1.62636623, 2.05127246])

random_draw(sample_shape=5, distribution='poisson', lam=10)
# generates: array([12,  8,  7, 14,  8])

random_draw(sample_shape=(2,2), distribution='binomial', num=2, prob=0.3)
#generates: array([[0, 0],
#                  [1, 0]])


#NormalDistribution

nd = NormalDistribution(mean=3, sd=1, sample_shape=5)
nd.draw()
#generates array([3.59149631, 3.13146966, 3.98872244, 3.59125381, 4.36412151])
nd.summarise()
#generates:
#Min: 3.1314696620512454
#Max: 4.3641215077437945
#Mean: 3.733412745193425
#Standard Deviation: 0.41609169604466906

#PoissonDistribution

pd = PoissonDistribution(lam=(2,3,2), sample_shape=[2,2,3])
pd.draw()
#generates:
#array([[[0, 0, 2],
#        [2, 1, 1]],
#
#       [[3, 3, 1],
#       [2, 1, 3]]])
pd.summarise()
#generates:
#Min: 0
#Max: 3
#Mean: 1.5833333333333333
#Standard Deviation: 1.0374916331657276

#BinomialDistribution

bd = BinomialDistribution(num=4, prob=0.5, sample_shape=6)
bd.draw()
#generates: array([2, 3, 2, 1, 1, 1])
bd.summarise()
#generates: 
#Min: 1
#Max: 3
#Mean: 1.6666666666666667
#Standard Deviation: 0.74535599249993

License

MIT

Project details


Release history Release notifications | RSS feed

This version

1

Download files

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

Source Distribution

kavanaghdistributions-1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kavanaghdistributions-1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file kavanaghdistributions-1.tar.gz.

File metadata

  • Download URL: kavanaghdistributions-1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for kavanaghdistributions-1.tar.gz
Algorithm Hash digest
SHA256 5b309df665ec96cd2247085d19bb4e531074a15acd7aed0cd23b690357dcc284
MD5 7a0b17ee4a8318536a6af41704785f44
BLAKE2b-256 816d1ee124cc89c29f5f9258e86cadd962ede6bb95120da32d6d6dc5f91c5e1f

See more details on using hashes here.

File details

Details for the file kavanaghdistributions-1-py3-none-any.whl.

File metadata

  • Download URL: kavanaghdistributions-1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for kavanaghdistributions-1-py3-none-any.whl
Algorithm Hash digest
SHA256 6972e3401163bbd0e2e3d7b80a75f7ae6aaa7101447ef28dcf3485d7524c4f1c
MD5 67dda5874cf208a54e592b276e022157
BLAKE2b-256 912a49384b58eeb1eb2a25731c771fca92fc94419a2d0e9e87e378b629ab83d9

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