Suppose I have a DataFrame of created like this:
import pandas as pd
s1 = pd.Series([\'a\', \'b\', \'a\', \'c\', \'a\', \'b\'])
s2 = pd.Series([\'a\', \'f\',
I would shove the Series into a collections.Counter
(documentation) (You might need to convert it to a list first). I am not a pandas
expert, but I think you should be able to fold the Counter
object back into a Series
, indexed by the strings, and use that to make your plots.
This is not working because it is (rightly) raising errors when it tries to guess where the bin edges should be, which simply makes no sense with strings.