简体   繁体   English

Jupyter Notebook %matplotlib 内联不起作用

[英]Jupyter Notebook %matplotlib inline Not Working

I'm trying to use Jupyter notebook for the first time and following tutorials, but I'm having trouble getting plots to actually draw.我第一次尝试使用 Jupyter Notebook 并遵循教程,但我无法实际绘制绘图。 I'm using the %matplotlib inline command, and its not giving me an error, but it's not drawing any plots either.我正在使用 %matplotlib 内联命令,它没有给我一个错误,但它也没有绘制任何图。

My notebook is:我的笔记本是:

%matplotlib inline

import pandas as pd
import matplotlib.pyplot as plt
In [2]:
df = pd.read_csv('election results.csv', index_col='ons_id')
In [3]:
df['valid_votes-2015'].plot
Out[3]:
<pandas.tools.plotting.SeriesPlotMethods object at 0x000002B03AFEF6A0>

Any help would be appreciated.任何帮助,将不胜感激。

Thanks谢谢

You need to call plot() :你需要调用plot()

df['valid_votes-2015'].plot()

You just get the method object plot with:您只需使用以下方法获取方法对象plot

df['valid_votes-2015'].plot

but you need to make it do something with the added parenthesis.但是你需要用添加的括号让它做一些事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM