如何处理没有属性explore的GeoDataFrame对象?
How to deal with GeoDataFrame object having no attribute explore?
我已经重新安装了 geopandas,但仍然出现错误:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [35], in <cell line: 1>()
----> 1 df.explore("pop_est", cmap="Blues")
File ~\Anaconda3\envs\GPD\lib\site-packages\pandas\core\generic.py:5575, in NDFrame.__getattr__(self, name)
5568 if (
5569 name not in self._internal_names_set
5570 and name not in self._metadata
5571 and name not in self._accessors
5572 and self._info_axis._can_hold_identifiers_and_holds_name(name)
5573 ):
5574 return self[name]
-> 5575 return object.__getattribute__(self, name)
AttributeError: 'GeoDataFrame' object has no attribute 'explore'
我使用的代码是:
df = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
df.explore("pop_est", cmap="Blues")
谢谢!
gdf.explore()
在 0.10 版(2021 年 10 月 3 日)中添加到 geopandas。参见changelog。所以为了能够使用探索,你需要更新,例如:
pip install --upgrade geopandas
或
conda install -c conda-forge geopandas>=0.10.0
我已经重新安装了 geopandas,但仍然出现错误:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [35], in <cell line: 1>()
----> 1 df.explore("pop_est", cmap="Blues")
File ~\Anaconda3\envs\GPD\lib\site-packages\pandas\core\generic.py:5575, in NDFrame.__getattr__(self, name)
5568 if (
5569 name not in self._internal_names_set
5570 and name not in self._metadata
5571 and name not in self._accessors
5572 and self._info_axis._can_hold_identifiers_and_holds_name(name)
5573 ):
5574 return self[name]
-> 5575 return object.__getattribute__(self, name)
AttributeError: 'GeoDataFrame' object has no attribute 'explore'
我使用的代码是:
df = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
df.explore("pop_est", cmap="Blues")
谢谢!
gdf.explore()
在 0.10 版(2021 年 10 月 3 日)中添加到 geopandas。参见changelog。所以为了能够使用探索,你需要更新,例如:
pip install --upgrade geopandas
或
conda install -c conda-forge geopandas>=0.10.0