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.

filter_none

edit
close

play_arrow

link
brightness_4
code

# import numpy
import numpy as np
  
# using np.gumbel() method
gfg = np.random.gumbel(12, 0.7, 20)
  
print(gfg)

chevron_right


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 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# import numpy
import numpy as np
  
# using np.gumbel() method
gfg = np.random.gumbel(0, 1.7, 10)
  
print(gfg)

chevron_right


Output :

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

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.