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