question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spike and Segments datashader operation not renaming dimensions correctly

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
philippjfrcommented, Jan 6, 2020

This has been fixed.

1reaction
philippjfrcommented, Oct 24, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found