pandas 情节不会在 Jupyter 中显示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35916976/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Plot won't show in Jupyter
提问by steve zissou
I'm new to python and I began to teach myself how to use pandas on jupyter using the exercise from this link:
我是 python 的新手,我开始使用以下链接中的练习自学如何在 jupyter 上使用 Pandas:
I have the problem that the plot at 1.3 won't appear when I do it in Jupyter, I only get the following output:
我的问题是,在 Jupyter 中执行时不会出现 1.3 处的图,我只得到以下输出:
matplotlib.axes._subplots.AxesSubplot at 0x8ad24a8>"
However it does appear when I run the same code in Spyder. Does anyone know why this is? This is my code:
但是,当我在 Spyder 中运行相同的代码时它会出现。有人知道为什么是这样吗?这是我的代码:
import pandas as pd
import os
fixed_df = pd.read_csv('bikes.csv', sep=';', encoding='latin1', parse_dates=['Date'], dayfirst=True, index_col='Date')
fixed_df['Berri1'].plot()
回答by dapaz
add the code below before your plots:
在您的绘图之前添加以下代码:
%matplotlib inline