简体   繁体   English

如何删除DataFrame的索引列?

[英]How to drop the index column of DataFrame?

I want to get rid of the index column that the Pandas DataFrame prints out in default. 我想摆脱默认情况下Pandas DataFrame打印出的索引列。 Is this possible? 这可能吗?

Thank you for your help! 谢谢您的帮助!

As @EdChum noted, not sure there's any way to do this by default. 正如@EdChum指出的那样,不确定默认情况下有任何方法可以执行此操作。 For display purposes, you could do: 出于显示目的,您可以执行以下操作:

print(df.to_string(index=False))

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

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