**New here?**Learn about Bountify and follow @bountify to get notified of new bounties! Follow @bountify x

Looking for a python function and plot that plots the probability of a peak number of web calls for a given time period. For examples assuming:

`avg`

is an average amount of calls in an hour.

A function like:

`def pcalc (average = avg, probability = p):`

`# p is range starts from .001`

`Return(max_calls_for_probability)`

A plot function where:

`y_axis is the probability in %`

.

`x_axis is the number of web calls for the time period`

The plot needs to show the distribution curve like what's below; options that provide better insight and visualization welcome and rewarded.

`from scipy.stats import poisson`

`import matplotlib.pyplot as plt`

.

`x2 = pcalc(avg)`

.

`plt.plot(x2, poisson.pmf(x2,tph))`

.

`plt.title("Probable Peak Calls")`

`plt.xlabel('Calls per Hour')`

`plt.ylabel('Probability %')`

.

## 1 Solution

Hi

I'm not sure that it will fit your need but here is my proposition :

```
from scipy.stats import norm
import matplotlib.pyplot as plt
average=int(input("Enter average calls per hour [default = 500] :") or 500)
probability = int(input("Enter probability to get the average call per hour (range 1 (low prob) to 10 (high prob)) [default = 3] :") or 3)
x = range(0,2*average)
y = norm.pdf(x, average, average / probability)
plt.plot(x, y)
plt.title("Probable Peak Calls")
plt.xlabel('Calls per Hour')
plt.ylabel('Probability %')
plt.show()
```

It will ask for your average calls per hour and your probability (from 1 to 10) to have the average call per hour. That will generate the graphe of the "normal law" with probability to have a the amount of call reached.