CoCalc Shared Filesscipy-stats-poisson.ipynbOpen in CoCalc with one click!
Author: Harald Schilly
Views : 35
In [1]:
from scipy.stats import poisson
In [2]:
mu = 1
In [3]:
rv = poisson(mu)

Cumulative distribution function

In [4]:
rv.cdf(.5)
0.36787944117144245

Sample 100 values

In [5]:
rv.rvs(size=100)
array([0, 1, 3, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 2, 1, 1, 0, 1, 1, 0, 1, 2, 0, 1, 1, 1, 2, 0, 3, 0, 0, 2, 3, 0, 2, 0, 2, 2, 1, 1, 1, 0, 2, 0, 2, 0, 0, 1, 0, 1, 0, 0, 3, 0, 1, 2, 0, 0, 1, 2, 1, 0, 0, 1, 0, 0, 0, 2, 1, 1, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 0, 3, 0, 1, 0, 1, 0, 2, 1, 2, 0, 0, 1])
In [6]:
dir(rv)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'a', 'args', 'b', 'cdf', 'dist', 'entropy', 'expect', 'interval', 'isf', 'kwds', 'logcdf', 'logpdf', 'logpmf', 'logsf', 'mean', 'median', 'moment', 'pdf', 'pmf', 'ppf', 'random_state', 'rvs', 'sf', 'stats', 'std', 'var']
In [ ]: