Traceback (most recent call last):
File "D:\35433\Documents\机器学习\任务二\任务二.py", line 89, in <module>
contour = plt.contourf(xx, yy, Z, alpha=0.4, cmap='RdYlBu', levels=np.linspace(0,1,100))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\python\Lib\site-packages\matplotlib\pyplot.py", line 3181, in contourf
__ret = gca().contourf(
^^^^^^^^^^^^^^^
File "D:\python\Lib\site-packages\matplotlib\__init__.py", line 1521, in inner
return func(
^^^^^
File "D:\python\Lib\site-packages\matplotlib\axes\_axes.py", line 6760, in contourf
contours = mcontour.QuadContourSet(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\python\Lib\site-packages\matplotlib\contour.py", line 708, in __init__
kwargs = self._process_args(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\python\Lib\site-packages\matplotlib\contour.py", line 1326, in _process_args
x, y, z = self._contour_args(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\python\Lib\site-packages\matplotlib\contour.py", line 1370, in _contour_args
z = ma.masked_invalid(z, copy=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\python\Lib\site-packages\numpy\ma\core.py", line 2426, in masked_invalid
res = masked_where(~(np.isfinite(a)), a, copy=copy)
^^^^^^^^^^^^^^
TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''报错
最新发布