在 Ipython notebook/Jupyter 中,Pandas 没有显示我尝试绘制的图形 [英] in Ipython notebook / Jupyter, Pandas is not displaying the graph I try to plot

查看:50
本文介绍了在 Ipython notebook/Jupyter 中,Pandas 没有显示我尝试绘制的图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 Ipython Notebook 中使用 Pandas 绘制一些数据,虽然它给了我对象,但它实际上并没有绘制图形本身.所以它看起来像这样:

I am trying to plot some data using pandas in Ipython Notebook, and while it gives me the object, it doesn't actually plot the graph itself. So it looks like this:

In [7]:

pledge.Amount.plot()

Out[7]:

<matplotlib.axes.AxesSubplot at 0x9397c6c>

图表应该紧随其后,但它根本没有出现.我已经导入了 matplotlib,所以这不是问题.我还需要导入其他模块吗?

The graph should follow after that, but it simply doesn't appear. I have imported matplotlib, so that's not the problem. Is there any other module I need to import?

推荐答案

请注意,--pylab 已被弃用并已从 IPython 的较新版本中删除,在 IPython Notebook 中启用内联绘图的推荐方法现在是运行:

Note that --pylab is deprecated and has been removed from newer builds of IPython, The recommended way to enable inline plotting in the IPython Notebook is now to run:

%matplotlib inline
import matplotlib.pyplot as plt

参见来自 ipython-dev 的 这篇文章邮件列表了解更多详情.

See this post from the ipython-dev mailing list for more details.

这篇关于在 Ipython notebook/Jupyter 中,Pandas 没有显示我尝试绘制的图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆