0

我正在使用 Geoviews 和 Python 来绘制田野中的杂草。我想使用四边形来可视化我们的数据,类似于geoviews 网站上的示例。我有以下代码:

d_dict = {
    'Latitude': lats,
    'Longitude': lons,
    'Broadleaf': weed_broadleaf
}

df = pd.DataFrame(pd_dict, columns=pd_dict.keys())
my_ds = gv.Dataset(df, kdims=['Latitude', 'Longitude'], vdims=['Broadleaf'])
my_qmesh = my_ds.to(gv.QuadMesh)

运行代码会产生以下错误:

Traceback (most recent call last):
  File "~/repos/ag-image-import/heatmap_demo.py", line 87, in <module>
    my_qmesh = my_ds.to(gv.QuadMesh)
  File "~/anaconda3/envs/pygroundskeeper/lib/python3.7/site-packages/geoviews/element/__init__.py", line 39, in __call__
    converted = super(GeoConversion, self).__call__(*args, **kwargs)
  File "~/anaconda3/envs/pygroundskeeper/lib/python3.7/site-packages/holoviews/core/data/__init__.py", line 178, in __call__
    element = new_type(selected, **params)
  File "~/anaconda3/envs/pygroundskeeper/lib/python3.7/site-packages/geoviews/element/geo.py", line 110, in __init__
    super(_Element, self).__init__(data, kdims=kdims, vdims=vdims, **kwargs)
  File "~/anaconda3/envs/pygroundskeeper/lib/python3.7/site-packages/holoviews/element/raster.py", line 784, in __init__
    super(QuadMesh, self).__init__(data, kdims, vdims, **params)
  File "~/anaconda3/envs/pygroundskeeper/lib/python3.7/site-packages/holoviews/core/data/__init__.py", line 351, in __init__
    datatype=kwargs.get('datatype'))
  File "~/anaconda3/envs/pygroundskeeper/lib/python3.7/site-packages/holoviews/core/data/interface.py", line 292, in initialize
    raise DataError(error)
holoviews.core.data.interface.DataError: None of the available storage backends were able to support the supplied data format.

在将数据读入 Geoviews 数据集之前,我曾尝试将数据转换为 XArray 数据集而不是 pandas 字典,但这会产生相同的错误。

4

0 回答 0