Python | Numpy np.gumbel () method

Using the np.gumbel() method, we can get the distribution of the gumbel as an array using np.gumbel () .

Syntax: np.gumbel (value, scale, size)

Return: Return the array of gumbel distribution.

Example # 1:
In this example, we can see that with np.gumbel () we can get an array of the Gumbel distribution using this method.

# NumPy import

import numpy as np

 
# using the np.gumbel () method

gfg = np.random.gumbel ( 12 , 0.7 , 20 )

 

print (gfg)

Output:

array ([12.64947204, 12.37405666, 13.58474571, 14.91257252, 12.52167875,
12.4480617, 14.95250558, 11.70944994, 12.8006472181, <11.6022 /> 11.877631, 11.5397349, 12.46834902, 13.27323288, 14.93137191,
11.95035735, 12.54426051, 11.1745507, 13.10580066, 14.41014362])

Example # 2: / p>

# NumPy import

import numpy as np

  
# and Using the np.gumbel () method

gfg = np.random.gumbel ( 0 , 1.7 , 10 )

 

print (gfg)

Output:

[5.34883666 -0.98597658 2.35585763 1.45700115 -2.62043708 -0.61983442
1.8046374 -1.73997392 4.29301495 1.82840768]