#importing the random module from numpy import random #applying the Rayleigh function res_arr= random.rayleigh(size=4,scale=2.0) #printing the results print('1D array of size(1,5) having Rayleigh distribution with scale 2.0 :\n') print(res_arr)
#importing the random module from numpy import random #here we are using Rayleigh function to generate Rayleigh distribution of size 2 x 5 with default scale value res_arr = random.rayleigh(size=(2,5)) print('2D Rayleigh Distribution as output from rayleigh() function:\n') #printing the result print(res_arr)
#importing the random module from numpy import random #here we are using Rayleigh function to generate Rayleigh distribution of size 2 x 4 x 2 res = random.rayleigh(size=(2,4,2), scale=1.5) print('3D Rayleigh Distribution as output from rayleigh() function:\n') #printing the result print(res)
#importing all the required modules and packages from numpy import random import matplotlib.pyplot as mpl import seaborn as sb #here we are using Rayleigh function to generate distributions of size 2000 with standard deviation 1 sb.distplot(random.rayleigh(size=2000), hist=False, label='Rayleigh Distribution') #plotting the graph mpl.show()