您说:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
File /opt/anaconda3/lib/python3.12/site-packages/geopandas/plotting.py:739, in plot_dataframe(df, column, cmap, color, ax, cax, categorical, legend, scheme, k, vmin, vmax, markersize, figsize, legend_kwds, categories, classification_kwds, missing_kwds, aspect, autolim, **style_kwds)
738 try:
--> 739 import mapclassify
741 except ImportError:
ModuleNotFoundError: No module named 'mapclassify'
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
Cell In[77], line 3
1 fig, ax = plt.subplots(1, figsize=(10,10))
----> 3 tripsViz.plot(ax=ax, column='N_trips', k=10, scheme='Quantiles', legend=True,
4 legend_kwds={'loc': 'upper left'})
File /opt/anaconda3/lib/python3.12/site-packages/geopandas/plotting.py:968, in GeoplotAccessor.__call__(self, *args, **kwargs)
966 kind = kwargs.pop("kind", "geo")
967 if kind == "geo":
--> 968 return plot_dataframe(data, *args, **kwargs)
969 if kind in self._pandas_kinds:
970 # Access pandas plots
971 return PlotAccessor(data)(kind=kind, **kwargs)
...
--> 742 raise ImportError(mc_err)
744 if Version(mapclassify.__version__) < Version("2.4.0"):
745 raise ImportError(mc_err)
ImportError: The 'mapclassify' package (>= 2.4.0) is required to use the 'scheme' keyword.
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...
这个为什么生成不出来:
fig, ax = plt.subplots(1, figsize=(10,10))
tripsViz.plot(ax=ax, column='N_trips', k=10, scheme='Quantiles', legend=True,
legend_kwds={'loc': 'upper left'})---------------------------------------------------------------------------
模块未找到错误 回溯(最近的调用最后一次)
文件 /opt/anaconda3/lib/python3.12/site-packages/geopandas/plotting.py:739, 在 plot_dataframe(df, column, cmap, color, ax, cax, categorical, legend, scheme, k, vmin, vmax, markersize, figsize, legend_kwds, categories, classification_kwds, missing_kwds, aspect, autolim, **style_kwds)
738 尝试:
导入 mapclassify
741 除了 ImportError:
模块未找到错误:没有名为'mapclassify'的模块
在处理上述异常时,发生了另一个异常:
ImportError 回溯(最近的调用最后)
单元格 In[77],第 3 行
1 fig, ax = plt.subplots(1, figsize=(10,10))
----> 3 tripsViz.plot(ax=ax, column='N_trips', k=10, scheme='Quantiles', legend=True,
4 legend_kwds={'loc': '左上角'})
文件 /opt/anaconda3/lib/python3.12/site-packages/geopandas/plotting.py:968, 在 GeoplotAccessor.__call__(self, *args, **kwargs)
966 kind = kwargs.pop("kind", "地理")
如果 kind == "geo":
返回绘图数据框(data, *args, **kwargs)
如果类型在 self._pandas_kinds 中:
访问 pandas 图表
971 return PlotAccessor(data)(kind=kind, **kwargs)
...
引发 ImportError(mc_err)
744 如果 Version(mapclassify.__version__) < Version("2.4.0"):
745 引发 ImportError(mc_err)
ImportError: 使用'scheme'关键字需要'mapclassify'包(>= 2.4.0)。
输出被截断。查看为可滚动元素或在文本编辑器中打开。调整单元格输出设置...
这个为什么生成不出来:
fig, ax = plt.subplots(1, figsize=(10,10))
tripsViz.plot(ax=ax, column='N_trips', k=10, scheme='Quantiles', legend=True,
legend_kwds={'loc': '左上角'})