#importing the random module from numpy import random #applying the exponential function res_arr= random. exponential(scale = 2.5, size=5) #printing the results print('1D array of size(1,5) having exponential distribution with scale 2.5:\n') print(res_arr)
#importing the random module from numpy import random #here we are using exponential function to generate exponential distribution of size 6 x 2 with default scale value res_arr = random.exponential(size=(6,2)) print('2D Exponential Distribution as output from exponential() function:\n') #printing the result print(res_arr)
#importing the random module from numpy import random #here we are using exponential function to generate exponential distribution of size 3 x 3 x 5 res = random.exponential(size=(3,3,5), scale=0.8) print('3D Exponential Distribution as output from exponential() 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 exponential function to generate distributions of size 1000 with scale 1.5 sb.distplot(random.exponential(size=1000,scale=1.5), hist=False, label='Exp Distr') #plotting the graph mpl.show()