-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Using multi-lines defined in separate columns #283
Comments
Something like this could be incorporated to reformat NumPy arrays of lines into a DataFrame that will work well with datashader (following the info in #286):
|
Thanks for the example. I originally thought you were asking for something like what I've just written up in #289, so I've changed the title of this issue to reflect that you're really asking for a convenient way to work with lines defined in independent arrays/columns, as opposed to a single unified dataframe separated with NaNs. The code is helpful, but because it accepts only a single x array, it will only work for a fairly specialized scenario where all lines have the same number of samples and all samples are stored in a single array. Datashader will happily work with any number of different lines of different sizes, which in NumPy could be represented variously as pairs of x and y arrays matching in size, or as single arrays with x and y columns. It's hard to see why we would provide a function for the above special case if we didn't also cover these other cases; I don't think any one of them is particularly more common than the others. And generalizing the above example to cover all those cases could get tricky. So the above code is definitely useful as an example, but I'm not sure it makes sense to be part of the library as it is. |
Also, similar issues apply to Pandas dataframes that have dozens or hundreds of columns, where someone may reasonably want to be able to specify a list of those names and then plot them directly, rather than by constructing another dataframe concatenating them. |
I think this issue is addressed by the separately developed ds.utils.dataframe_from_multiple_sequences utility. |
It would be useful to be able to use Datashader to directly plot data from NumPy arrays, particularly for plotting lines. This Stack Overflow question and response demonstrates the workaround I used to put the data into a DataFrame. I am not sure if there is a simple way to accept both types of input. As a fundamental data structure for scientific data, I think it worth considering adding support for NumPy array.
The text was updated successfully, but these errors were encountered: