# NumPy Pareto Distribution (Python Tutorial)

This is a detailed tutorial of NumPy Pareto Distribution. Learn to get Pareto Distribution data using NumPy and visualize using Seaborn.

## Pareto Distribution

This distribution is based on Pareto’s law which works on the Pareto principle. The Pareto principle states that for every occurring event constitutes 80% of the effects, whereas 20% is the causes. This is also known as  80/20 rule or the law of vital few or the principle of factor sparsity. This concept is brought into consideration in the context of the distribution of the income or wealth among people.

Pareto Distribution takes in two parameters:

• `a` – It will account for the shape parameter.
• `size` – This will help us in giving the shape of the array.

let us take an example to understand it better:

```# here first we will import the numpy package with random module
from numpy import random
# we will use method
x=random.pareto( a=3,size=(3,3))
#now we will print the data
print(x)```

Output.

```[[ 0.48798677  0.11891093  0.08954629]
[ 0.30622926  0.52758844  0.2012538 ]
[ 2.73218563  0.46943909  0.24430034]]```

Here in this example, we are taking the shape parameter as three, and the size of the array will be a 3*3 matrix. Let us take another example with different values:

```# here first we will import the numpy package with random module
from numpy import random
# we will use method
x=random.pareto( a=2,size=(2,4))
#now we will print the data
print(x)```

Output.

```[[ 0.81509185  0.18356816  0.13728295  0.49289448]
[ 0.88803285  0.31659488  6.21015922  0.78126028]]```

Here in this example, we are taking the shape parameter as two and size of the array as (2,4) which gives the following distribution.

### Visualization of Pareto Distribution

Here we are going the above take data.

```# here first we will import the numpy package with random module
from numpy import random
#here we will import matplotlib
import matplotlib.pyplot as plt
#now we will import seaborn
import seaborn as sns
# so we will now plot a displot here
sns.distplot(random.pareto(a=3,size=500), hist=False)
# now we have the plot printed
plt.show()```

Output.

Let us take another example where we will take another set of data.

```# here first we will import the numpy package with random module
from numpy import random
#here we ill import matplotlib
import matplotlib.pyplot as plt
#now we will import seaborn
import seaborn as sns
# so we will now plot a displot here
sns.distplot(random.pareto(a=2,size=1000), hist=False)
# now we have the plot printed
plt.show()```

Output.

Let us take another example to study the differences:

```# here first we will import the numpy package with random module
from numpy import random
#here we ill import matplotlib
import matplotlib.pyplot as plt
#now we will import seaborn
import seaborn as sns
# so we will now plot a displot here
sns.distplot(random.pareto(a=5,size=700), hist=False)
# now we have the plot printed
plt.show()```

Output.

I hope you found this guide useful. If so, do share it with others who are willing to learn Numpy and Python. If you have any questions related to this article, feel free to ask us in the comments section.

And do not forget to subscribe to WTMatter!