据帧的漂亮输出Jupyter

问题描述 投票:3回答:3

我有一个远程Ubuntu和本地OSX两种安装IPython的笔记本。当我尝试输出熊猫数据帧我得到了不同的输出。查看截图。

Jupyter (ubuntu): IPython (osx):

我想在jupyter Ubuntu的漂亮表格。

我该怎么办?我搜索了很多,但一无所获。

pandas ipython ipython-notebook jupyter
3个回答
6
投票

除了那些上面有另一个很好的工具[IpyTable][1]

# create dummy data:
import pandas as pd
from numpy.random import randn, randint
df = pd.DataFrame({'a': randn(1000), 'b': randn(1000),'N': randint(100, 1000, (1000)), 'x': 'x'})

from ipy_table import make_table, set_row_style
#apply_theme('basic')
table = make_table(df[0:10].values.tolist(), len(df.columns))
set_row_style(0, color='lightGreen')
table

enter image description here


0
投票

解决了清洁新安装通过画中画VIRTUALENV。


0
投票

此代码为我工作:

,"from Ipython.display import display,HTML"
"df_xyz=(...)"

“显示”(DF)

© www.soinside.com 2019 - 2024. All rights reserved.