在Jupyter Notebook中运行代码报错,寻求AI帮助无果,有没有人帮忙看看
代码:
import matplotlib.pyplot as plt
import seaborn as sns
# 可视化缺失情况
sns.heatmap(df.isnull(), yticklabels=False, cbar=False, cmap='viridis')
plt.show()
报错信息:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[33], line 1
----> 1 import matplotlib.pyplot as plt
2 import seaborn as sns
3 # 可视化缺失情况
File ~\PyCharmMiscProject\.venv\Lib\site-packages\matplotlib\pyplot.py:66
63 from matplotlib import _docstring
64 from matplotlib.backend_bases import (
65 FigureCanvasBase, FigureManagerBase, MouseButton)
---> 66 from matplotlib.figure import Figure, FigureBase, figaspect
67 from matplotlib.gridspec import GridSpec, SubplotSpec
68 from matplotlib import rcsetup, rcParamsDefault, rcParamsOrig
File ~\PyCharmMiscProject\.venv\Lib\site-packages\matplotlib\figure.py:40
37 import numpy as np
39 import matplotlib as mpl
---> 40 from matplotlib import _blocking_input, backend_bases, _docstring, projections
41 from matplotlib.artist import (
42 Artist, allow_rasterization, _finalize_rasterization)
43 from matplotlib.backend_bases import (
44 DrawEvent, FigureCanvasBase, NonGuiException, MouseButton, _get_renderer)
File ~\PyCharmMiscProject\.venv\Lib\site-packages\matplotlib\projections\__init__.py:55
1 """
2 Non-separable transforms that map from data space to screen space.
3
(...) 52 `matplotlib.projections.polar` may also be of interest.
53 """
---> 55 from .. import axes, _docstring
56 from .geo import AitoffAxes, HammerAxes, LambertAxes, MollweideAxes
57 from .polar import PolarAxes
File ~\PyCharmMiscProject\.venv\Lib\site-packages\matplotlib\axes\__init__.py:2
1 from . import _base
----> 2 from ._axes import Axes # noqa: F401
4 # Backcompat.
5 Subplot = Axes
File ~\PyCharmMiscProject\.venv\Lib\site-packages\matplotlib\axes\_axes.py:66
61 func.__qualname__ = f"Axes.{func.__name__}"
62 return func
65 @_docstring.interpd
---> 66 class Axes(_AxesBase):
67 """
68 An Axes object encapsulates all the elements of an individual (sub-)plot in
69 a figure.
(...) 94
95 """
96 ### Labelling, legend and texts
File ~\PyCharmMiscProject\.venv\Lib\site-packages\matplotlib\axes\_axes.py:223, in Axes()
219 handles, labels = mlegend._get_legend_handles_labels(
220 [self], legend_handler_map)
221 return handles, labels
--> 223 @_docstring.dedent_interpd
224 def legend(self, *args, **kwargs):
225 """
226 Place a legend on the Axes.
227
(...) 339 .. plot:: gallery/text_labels_and_annotations/legend.py
340 """
341 handles, labels, kwargs = mlegend._parse_legend_args([self], *args, **kwargs)
AttributeError: module 'matplotlib._docstring' has no attribute 'dedent_interpd'