3

升级到 Holoviews 1.9.2 版,现在我收到以下错误:

    DataError: None of the available storage backends were able to support the supplied data format. XArrayInterface raised following error:

 cannot create a Dataset from a DataArray with the same name as one of its coordinates

尝试通过 panda DataFrame 中的分类字段进行聚合时会出现问题。

       hover_opts = hv.opts("QuadMesh [tools=['hover']] (alpha=0 hover_alpha=0.2)")            
       self._points = hv.Points(df,kdims=[xFieldName,yFieldName])         
       self._dynamic_hover = datashade(self._points) * dynspread(datashade(self._points, aggregator=ds.count_cat(colorFieldName))) * \
         hv.util.Dynamic(aggregate(self._points, width=50, height=50, streams=[RangeXY]),operation=hv.QuadMesh) 

如果我删除聚合器,我会失去我点上的颜色,但情节有效:

hover_opts = hv.opts("QuadMesh [tools=['hover']] (alpha=0 hover_alpha=0.2)")            
           self._points = hv.Points(df,kdims=[xFieldName,yFieldName])         
           self._dynamic_hover = datashade(self._points) * dynspread(datashade(self._points)) * \
             hv.util.Dynamic(aggregate(self._points, width=50, height=50, streams=[RangeXY]),operation=hv.QuadMesh)

我只需要通过这个字段给点颜色。

4

0 回答 0