-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
df.my_column.plot(datashade=True)
gives strange graphs when my_column dtype=uint32
#670
Comments
If nothing else, at least the resulting plot is pretty! :-) Generally Datashader uses uint types for indexing and not for data, but if uint is indeed not supported, we should warn when it is supplied. Definitely needs some investigation and probably either a fix or a better error message in Datashader. It's also possible that this is an hvPlot issue, if hvPlot is converting the data before passing it to Datashader, but my guess would be Datashader. |
@jbednar not sure I understand, do you suggest I open the issue in the Datashader project (not sure how to proceed after a month of silence :), am very open for any suggestion )? |
Someone could investigate, but no one has volunteered yet, so it's an open challenge. I am not sure it's a datashader issue, and mostly the same people work on both projects, so here is as good a place as any. For now there is a workaround, but if you'd like to investigate, the first step would be to trace though and see if the data is converted to a new type before calling datashader. Wish I had more details than that, but that's what needs investigating! |
This is properly a HoloViews problem where unsigned integer is not converted to integer. I can fix it by adding a check and conversion here: I will make a PR, but would like to make sure the fix works with the more advanced dataset. @jmakov Is it possible you can create some data with the same effect as the plots in your first post? |
@hoxbro hm... not sure what's in the original data but I cannot find a min example to reproduce. Instead I get a empty plot for l = [i for i in range(1000)]
df = pd.DataFrame(l)
df[df.columns[0]].astype(np.uint32).plot(datashade=True) |
Sorry if I wasn't clear, the plot I showed was with my fix in it. See the PR above my comment. |
ALL software version info
Ubuntu 20.04
Description of expected behavior and the observed behavior
Expected:
Got:
The original dtype is
numpy.uint32
(which gives the second figure). To get the first figure I have to change type:my_df.my_col = my_df.my_col.astype(np.int32)
Complete, minimal, self-contained example code that reproduces the issue
The only thing I noticed is the difference in
dtype
of data frame's column. The original isdtype: uint32
. When type is changed to e.g.dtype: int32
, it works as expected. When trying to reproduce I get an empty figure instead of a half colored plot (see the picture above). So not sure what else the difference could be.Stack traceback and/or browser JavaScript console output
Only a couple of warnings:
The text was updated successfully, but these errors were encountered: