I think
p.Series([1, 3, 5, 10, 12, 20, 21, 25]).hist(bins=[0, 10, 20, 30]).figure
will do what you want. Alternately you can do
p.Series([1, 3, 5, 10, 12, 20, 21, 25]).hist(bins=3, range=(0,30)).figure
See documentation for hist
and the documentation for np.histogram
.
I suspect you are also running into some issues because it is labeling the center of the bins, not the edges.