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 467 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()
answered Apr 5, 2022 by
• 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

## not able to see all columns and rows of a pandas DataFrame?

Hi@akhtar, Your data set contains lots of rows ...READ MORE

## 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

## how do i use the enumerate function inside a list?

Enumerate() method adds a counter to an ...READ MORE