Open In App

Python | Numpy np.gumbel() method

With the help of np.gumbel() method, we can get the gumbel distribution in the form of an array by using np.gumbel() method.

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



Return : Return the array of gumbel distribution.

Example #1 :
In this example we can see that by using np.gumbel() method, we are able to get an array of gumbel distribution using this method.




# import numpy
import numpy as np
  
# using 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.80072181, 11.60226466,
11.877631, 11.5397349, 12.46834902, 13.27323288, 14.93137191,
11.95035735, 12.54426051, 11.1745507, 13.10580066, 14.41014362])

Example #2 :




# import numpy
import numpy as np
  
# using 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]

Article Tags :