-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Series.hist() fails for String Series #5876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This also does not work with matplotlib (eg But should it work with non numeric data? A histogram is about binning? Maybe a better error message is possible. |
@JanSchulz What would you expect to happen here? Non-numeric data don't really make sense for a histogram, because nominal data (such as strings) don't have an ordering, can't be added together numerically and don't have any sort of multiplication operation that's germane to computing a histogram. That said, I agree with @jorisvandenbossche that the error message could be a bit less cryptic. |
I have noticed series.hist() also fails for datetime64ns series. It would be cool if we could handle this. I'm not sure how NumPy/MatplotLib computes the bucketing on these value types to get the histogram. If its just 64bit ints underlying then it should not be too hard to bucket with datetime bin edges. |
|
Actually I expected a bar plot (value -> count). So in the above example I wanted to have three bars, labels are "abc", "cde", "bcd" with the length of the bars 2, 1, 1. Usung plot with kind=bar also fails:
|
Thats what I wanted:
:-) |
I really want this feature, since most of the data I deal with is categorical, and so I can never use the convenience of I've hacked together something which provides this functionality using the Pandas Apologies if this is a dumb question, or if I'm rasing this in the wrong place, this would be my first contribution to Pandas and I'm having trouble wrapping my head around exactly where this fits in.
|
This doesn't raise an error anymore, it generates a plot. Not sure if the plot is meaningul, it's not equivalent to Example output:
|
Not sure if that's a pandas or a mathplotlib bug.
The text was updated successfully, but these errors were encountered: