Curriculum
Course: NumPy
Login

Curriculum

NumPy

Text lesson

Pareto Distribution

The Pareto distribution follows Pareto’s law, also known as the 80-20 rule (where 20% of factors account for 80% of the outcome).

It has two parameters:

a (shape parameter): Determines the distribution’s steepness.

size: Specifies the shape of the returned array.

Example

Generate a sample from the Pareto distribution with a shape parameter of 2 and a size of 2×3.

from numpy import random

x = random.pareto(a=2, size=(23))

print(x)

Visualization of Pareto Distribution

Example

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

sns.distplot(random.pareto(a=2, size=1000), kde=False)

plt.show()

Result

pareto1