问题: 如何在一个iPython NoteBook单元格中同时打印两个DataFrame表格,以便这两个表格都呈现出pretty table格式?
以下代码只能打印第二个表格,而print df.head()
无法显示pretty table。
df = pd.DataFrame(np.random.randn(6,4), index=pd.date_range('20150101', periods=6), columns=list('ABCD'))
df2 = pd.DataFrame(np.random.randn(6,4), index=pd.date_range('20150101', periods=6), columns=list('WXYZ'))
df.head()
df2.head()
以下方式无法生成所需的漂亮表格:
print df.head()
print df2.head()
display(df.head())
。 - joris