IPython Notebook cell 多路输出 [英] IPython Notebook cell multiple outputs

查看:40
本文介绍了IPython Notebook cell 多路输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 IPython Notebook 中运行这个单元:

I am running this cell in IPython Notebook:

# salaries and teams are Pandas dataframe
salaries.head()
teams.head()

结果是我只得到teams 数据帧的输出,而不是salariesteams 的输出.如果我只运行 salaries.head() 我会得到 salaries 数据框的结果但是在运行这两个语句时我只看到 teams.head 的输出().我该如何纠正?

The result is that I am only getting the output of teams data-frame rather than of both salaries and teams. If I just run salaries.head() I get the result for salaries data-frame but on running both the statement I just see the output of teams.head(). How can I correct this?

推荐答案

您是否尝试过 display 命令?

have you tried the display command?

from IPython.display import display
display(salaries.head())
display(teams.head())

这篇关于IPython Notebook cell 多路输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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