Mar-25-2019, 08:12 PM
I have two arrays where the first array shows the unique values extracted from a column and the second array stores the frequency of these unique values. How can I correctly plot the histogram?
(array([0, 1, 2, 3, 4], dtype=uint8), array([ 1, 20, 20, 30, 45], dtype=int64))
0,1,2,3,4 are the unique values and the numbers in the second array shows the frequency of each of the value.
I tried to do the code as below but it is not producing the correct histogram
(array([0, 1, 2, 3, 4], dtype=uint8), array([ 1, 20, 20, 30, 45], dtype=int64))
0,1,2,3,4 are the unique values and the numbers in the second array shows the frequency of each of the value.
I tried to do the code as below but it is not producing the correct histogram
b = ([0,1,2,3,4],[1,20,20,39,45]) x = b[0] print (x) y = b[1] print(y) plt.hist([x,y], bins='auto') plt.show()]Thank you