Spike and Segments datashader operation not renaming dimensions correctly
See original GitHub issueThe following example attempts to datashade Spikes
elements, showing one way that works as expected and two that don’t:
# In[1]
import holoviews as hv
import numpy as np
import pandas as pd
from holoviews.operation.datashader import rasterize
hv.extension('bokeh')
# In[2]
arr = np.random.rand(10) * 10
df = pd.DataFrame({'xpos':arr})
rasterize(hv.Spikes(arr), aggregator='count') # Works
# In[3]
rasterize(hv.Spikes(df.xpos), aggregator='count') # Doesn't work
# In[4]
rasterize(hv.Spikes(df, ['xpos']), aggregator='count') # Also doesn't work
The error message in both cases:
```
WARNING:param.dynamic_operation: Callable raised "DataError("xarray Dataset must define coordinates for all defined kdims, [Dimension('xpos')] coordinates not found.\n\nXArrayInterface expects gridded data, for more information on supported datatypes see http://holoviews.org/user_guide/Gridded_Datasets.html")". Invoked as dynamic_operation(height=400, scale=1.0, width=400, x_range=None, y_range=None)
```
This is somewhat surprising as a numpy array works, but a Series (which is array-like) does not.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Timeseries — Datashader v0.14.3
Antialiasing and using large widths does slow down the rendering and may make it more difficult to interpret large collections of line segments,...
Read more >Plotting Pitfalls — Datashader v0.14.3
Common plotting pitfalls that get worse with large data# · Overplotting · Oversaturation · Undersampling · Undersaturation · Underutilized range · Nonuniform ...
Read more >Releases — Datashader v0.14.3
Updated examples to show that xarray now requires dimension names to match before doing arithmetic or comparisons between arrays. Known issues: If you...
Read more >Interactivity — Datashader v0.14.3
However, these bare images do not show the data ranges or axis labels, ... import holoviews as hv import holoviews.operation.datashader as hd ...
Read more >python programming: Topics by Science.gov
In this paper we describe PySB, an approach in which models are not only created ... The program supports an arbitrary number of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This has been fixed.
This seems like a bug in datashader to me in that the DataArray returned by the line aggregator does not respect the name of the x-column you give it. I can push a simple fix in HoloViews and then file an issue in datashader.