I have a pandas dataframe with two columns, say x and y. For each row, x is the mean of a random variable following a poisson distribution. I want to add a third column, z, such that z = the probability that a random draw will be less than y.
For a given row, say x = 15 and I want to know the probability that a random draw will be less than y = 10. I know I can use:
from scipy.stats import poisson
x = 15
y = 10
z = poisson.cdf(y, x)
z
which returns 0.118
How do I do this for each row in a pandas dataframe, creating a third column?