Issue
I have a list such as [0.2,0.4,1.2,2.4,5.4,6.0,0.3,3.4..]
and I want to group the values in the list to a range(interval can change for different inputs) 0-1
,1-2
,2-3
and would like to plot a graph where the x-axis is the range and y-axis depicts the no_of_values
in the given range?
For the above problem, {0-1:3,1-2:1,2-3:1,3-4:1,4-5:0,5-6:2}
Thanks in advance
Solution
Try using pandas.DataFrame.hist
pd.DataFrame(ls).hist()
where ls = [0.2,0.4,1.2,2.4,5.4,6.0,0.3,3.4]
Answered By - iudeen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.