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

查看:842
本文介绍了在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, so the accepted answer will no longer work. The recommended way to enable inline plotting in the IPython Notebook is now to run:

%matplotlib inline
import matplotlib.pyplot as plt

参见这篇文章了解更多详情。

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

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