Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News Sign UpSign In
| Download
Views: 408
Kernel: Python 3 (Ubuntu Linux)
from scipy.stats import poisson
mu = 1
rv = poisson(mu)

Cumulative distribution function

rv.cdf(.5)
0.36787944117144245

Sample 100 values

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])
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']