机器学习写代码时遇到的问题(23.11.9)

AttributeError: module ‘backend_interagg‘ has no attribute ‘FigureCanvas‘

导包的时候改一下

import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt

UserWarning: Glyph 27425 (\N{CJK UNIFIED IDEOGRAPH-6B21}) missing from current font.   func(*args)

显示中文出问题

# 汉字字体,优先使用楷体,找不到则使用黑体
plt.rcParams['font.sans-serif'] = ['Kaitt', 'SimHei']  

ImportError: `iplot` can only run inside an IPython Notebook.

pip install ipython

ValueError: Mime type rendering requires nbformat>=4.2.0 but it is not installed

使用iplot出错

plotly.offline.iplot(plot_figure)

更新库:

pip install --upgrade nbformat

你可能感兴趣的:(代码实战,机器学习,人工智能)