numpy.random.triangular() in Python Last Updated : 18 Aug, 2020 Comments Improve Suggest changes Like Article Like Report With the help of numpy.random.triangular() method, we can get the random samples from triangular distribution from interval [left, right] and return the random samples by using this method. Syntax : numpy.random.triangular(left, mode, right, size=None) Parameters : 1) left - lower limit of the triangle. 2) mode - peak value of the distribution. 3) right - upper limit of the triangle. 4) size - total number of samples required. Return : Return the random samples as numpy array. Example #1 : In this example we can see that by using numpy.random.triangular() method, we are able to get the random samples of triangular distribution and return the numpy array. Python3 # import numpy import numpy as np import matplotlib.pyplot as plt # Using triangular() method gfg = np.random.triangular(-5, 0, 5, 5000) plt.hist(gfg, bins = 50, density = True) plt.show() Output : Example #2 : Python3 # import numpy import numpy as np import matplotlib.pyplot as plt # Using triangular() method gfg = np.random.triangular(-10, 8, 10, 15000) plt.hist(gfg, bins = 100, density = True) plt.show() Output : Comment More infoAdvertise with us Next Article numpy.random.triangular() in Python J jitender_1998 Follow Improve Article Tags : Python Python-numpy Python numpy-Random Practice Tags : python Similar Reads random.triangular() method in Python triangular() is an inbuilt method of the random module. It is used to return a random floating point number within a range with a bias towards one extreme. Syntax : random.triangular(low, high, mode) Parameters : low : the lower limit of the random number high : the upper limit of the random number 2 min read numpy.random.standard_t() in Python With the help of numpy.random.standard_t() method, we can get the random samples from standard T distribution having degree of freedom and return the random samples by using this method. Standard T distribution Syntax : numpy.random.standard_t(df, size=None) # Here df is degree of freedom. Return : 1 min read numpy.random.wald() in Python With the help of numpy.random.wald() method, we can get the random samples from Wald or Inverse Gaussian distribution and return the random samples as numpy array by using this method. Inverse Gaussian distribution Syntax : numpy.random.wald(mean, scale, size=None) Return : Return the random samples 1 min read numpy.random.rayleigh() in python With the help of numpy.random.rayleigh() method, we can get the random samples from Rayleigh distribution and return the random samples. Rayleigh distribution function Syntax : numpy.random.rayleigh(scale=1.0, size=None) Return : Return the random samples as numpy array. Example #1 : In this example 1 min read numpy.random.rand() in Python This article provides an in-depth exploration of the `numpy.random.rand()` function in Python. It covers the function's syntax, and definition, and includes illustrative examples with detailed explanations for better understanding. numpy.random.rand() Function Syntax The numpy.random.rand() function 3 min read Like