codingstreets
Search
Close this search box.
numPy-pareto-distribution

Introduction to Numpy Pareto Distribution

In This Article, You Will Learn About Numpy Pareto Distribution.

Numpy Pareto Distribution – Before moving ahead, let’s know a bit of Python Exponential Distribution

Pareto Distribution is distributed in the ratio of 80-20 distribution i.e., 20% factors cause 80% outcome.

It includes two parameters –

a – parameter shape.

size - Shape of the returned array.     

Example – Creating an array of random numbers of size 3×3 for Pareto distribution.

from numpy import random

z = random.pareto(a=2, size=(3, 3))

print(z)
Output - 

[[0.80365148 0.2705212  0.56911853]
 [0.00620553 0.98018188 1.63845207]
 [4.58486444 0.02704608 2.06710027]]

As shown above, it returned an array of shapes 3×3 containing random numbers.

Visualization of Pareto Distribution

Example – Visualizing the Pareto Distribution graph without histogram.

from numpy import random
import matplotlib.pyplot as plt
import seaborn as kl

kl.distplot(random.pareto(a=2, size=5000), kde=False)

plt.show()
numpy-pareto-distribution

Example – Visualizing the Pareto Distribution graph with histogram.

from numpy import random
import matplotlib.pyplot as plt
import seaborn as kl

kl.distplot(random.pareto(a=2, size=5000))

plt.show()
numpy-pareto-distribution

If you find anything incorrect in the above-discussed topic and have any further questions, please comment below.

Like us on

Recent Post

Popular Post

Top Articles

Archives
Categories

Share on