File ~/env/py311/lib/python3.11/site-packages/holoviews/element/raster.py:281, in Image.init(self, data, kdims, vdims, bounds, extents, xdensity, ydensity, rtol, params)
279 Dataset.init(self, data, kdims=kdims, vdims=vdims, extents=extents, params)
280 if not self.interface.gridded:
--> 281 raise DataError(
282 f"{type(self).name} type expects gridded data, "
283 f"{self.interface.name} is columnar. "
284 "To display columnar data as gridded use the HeatMap "
285 "element or aggregate the data (e.g. using np.histogram2d)."
286 )
288 dim2, dim1 = self.interface.shape(self, gridded=True)[:2]
289 if bounds is None:
DataError: Image type expects gridded data, DictInterface is columnar. To display columnar data as gridded use the HeatMap element or aggregate the data (e.g. using np.histogram2d).
This problem does not occur not always.
I have confirmed that this problematic xr.DataArray is 2-dimensional.
Therefore, I cannot figure out why this problem occurs. I believe the issue may lie in the process that determines whether the data is gridded or not.
If you need more information about this problematic xr.DataArray to fix the code, please let me know.
ALL software version info
OS: Mac OS Bokeh : 3.4.2 / 3.5.0
Description of expected behavior and the observed behavior
Clearly, xr.DataArray is regular grid from its definition. but I met the problem as follows:
DataError Traceback (most recent call last) Cell In[12], line 1 ----> 1 hv.Image(cut2_band)
File ~/env/py311/lib/python3.11/site-packages/holoviews/element/raster.py:281, in Image.init(self, data, kdims, vdims, bounds, extents, xdensity, ydensity, rtol, params) 279 Dataset.init(self, data, kdims=kdims, vdims=vdims, extents=extents, params) 280 if not self.interface.gridded: --> 281 raise DataError( 282 f"{type(self).name} type expects gridded data, " 283 f"{self.interface.name} is columnar. " 284 "To display columnar data as gridded use the HeatMap " 285 "element or aggregate the data (e.g. using np.histogram2d)." 286 ) 288 dim2, dim1 = self.interface.shape(self, gridded=True)[:2] 289 if bounds is None:
DataError: Image type expects gridded data, DictInterface is columnar. To display columnar data as gridded use the HeatMap element or aggregate the data (e.g. using np.histogram2d).
This problem does not occur not always.
I have confirmed that this problematic xr.DataArray is 2-dimensional.
Therefore, I cannot figure out why this problem occurs. I believe the issue may lie in the process that determines whether the data is gridded or not. If you need more information about this problematic xr.DataArray to fix the code, please let me know.