A histogram is a plot which shows the distribution of values in a set of data. The values are sorted first and then divided into classes/group of equal size.
So, in this article, we are going to use hist() function to plot the histogram of the sum of randomly generated numbers.
The function pylab.hist(vals, bin = 10) produces a histogram with 10 equally sized groups and the frequency of result in those classes.
So here is the code:
Output:

need an explanation for this answer? contact us directly to get an explanation for this answer