Given:
ser = Series(['one', 'two', 'three', 'two', 'two'])
How do I plot a basic histogram of these values?
Here is an ASCII version of what I’d want to see in matplotlib:
X
X X X
-------------
one two three
I’m tired of seeing:
TypeError: cannot concatenate 'str' and 'float' objects
You could use the
value_countsmethod:and then plot this as a bar chart:
Edit: I noticed that this doesn’t keep the desired order. If you have a list/Series for this ordering (in this case
ser[:3]will do) you canreindexbefore plotting: