简体   繁体   English

Zeppelin:如何使用索引打印熊猫数据框?

[英]Zeppelin: how to print pandas dataframe with index?

For example例如

if I use df.describe() directly,如果我直接使用df.describe()

![在此处输入图片说明

if I use z.show(df) , the result becomes如果我使用z.show(df) ,结果变成

在此处输入图片说明

I can't know which is uniq, count etc from the describe .我无法从describe知道哪个是 uniq、count 等。

How can I display pandas in full in Zeppelin?如何在 Zeppelin 中完整显示熊猫?

According to this PR it should display the index out of the box, but it doesn't work for me with Zeppelin 0.8 .根据这个PR,它应该显示开箱即用的索引,但它不适用于 Zeppelin 0.8 As a workaround you can call reset_index() :作为解决方法,您可以调用reset_index()

z.show(df.describe().reset_index())

The mentioned PR was merged into Zeppelin 0.9 and your can display the pandas dataframe properly with:提到的 PR 已合并到 Zeppelin 0.9 中,您可以使用以下命令正确显示 Pandas 数据框:

z.show(df.describe(), show_index=True)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM