显示图表 jupyter notebook

24 浏览
0 Comments

显示图表 jupyter notebook

在jupyter笔记本中,我无法看到这个图表:\n

feature_importances = pd.Series(clf.feature_importances_, index=columns)
feature_importances.sort_values(inplace=True)
feature_importances.plot(kind="barh", figsize=(7,6))

\n我只能看到matplotlib.axes._subplots.AxesSubplot at 0xda87c18

0
0 Comments

问题:在Jupyter Notebook中显示图形的问题。

原因:在Jupyter Notebook中,需要执行一个以%matplotlib inline开头的单元格,以确保图形能够正确显示。

解决方法:在Jupyter Notebook中执行一个以%matplotlib inline开头的单元格,以确保图形能够正确显示。在ipython notebook中,可以使用--matplotlib标志来启动笔记本服务器。

示例代码:

%matplotlib inline

0