![]() |
VOOZH | about |
Numpy provides us the feature to compute the Histogram for the given data set using NumPy.histogram() function. The formation of histogram depends on the data set, whether it is predefined or randomly generated.
Syntax : numpy.histogram(data, bins=10, range=None, normed=None, weights=None, density=None)
Case 1: Computing the Numpy Histogram with the help of Random Data set
Output:
👁 ImageIn the above example, we created a random data set using np.random.randint() and plot the Numpy Histogram
Case 2: Computing the Numpy Histogram with the help of Pre-defined Data set