情节不会在 Jupyter 中显示 [英] Plot won't show in Jupyter
本文介绍了情节不会在 Jupyter 中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 Python 的新手,我开始通过此链接中的练习自学如何在 jupyter 上使用 Pandas:
I'm new to python and I began to teach myself how to use pandas on jupyter using the exercise from this link:
我遇到的问题是,在 Jupyter 中执行时不会出现 1.3 处的图,我只得到以下输出:
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:
matplotlib.axes._subplots.AxesSubplot at 0x8ad24a8>"
但是当我在 Spyder 中运行相同的代码时它确实出现了.有人知道为什么是这样吗?这是我的代码:
However it does appear when I run the same code in Spyder. Does anyone know why this is? This is my code:
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()
推荐答案
在你的情节前添加以下代码:
add the code below before your plots:
%matplotlib inline
这篇关于情节不会在 Jupyter 中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文