I want to plot the probability density function of a Poisson distribution in python created using scipy. If I want to plot the pdf of a beta distribution, I would do something like the following:

x = np.linspace(0, 1, 200)
alphas = 4
betas = 10
pdf = st.beta.pdf(x, alpha, beta)
plt.plot(x, pdf, label=r'$\alpha$ = {}, $\beta$ = {}'.format(alpha, beta))


I thought I could do the same with a Poisson distribution, but unfortunately, the object does not have the pdf method! why? how can I plot a Poisson pdf without writing the formula myself?

Apr 4, 2022 218 views

## 1 answer to this question.

The poisson distribution has no density function and is a discontinuous distribution. It does, however, include a mass function, which you may use using the scipy.stats.poisson.pmf()
• 6,000 points

## How do I create a decision tree?

Let us consider the following example. Suppose a ...READ MORE

## How do I convert a pandas dataframe to a numpy array using python?

Try something like this: df.values array([[nan, 0.2, nan], ...READ MORE

## Transition matrix to have percentages instead of default probability - Markov chain

While using Markov chain, is it possible ...READ MORE

+1 vote

## how do i change string to a list?

suppose you have a string with a ...READ MORE

## how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote

## how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE