如何在没有索引的情况下打印Pandas DataFrame [英] How to print pandas DataFrame without index

查看:75
本文介绍了如何在没有索引的情况下打印Pandas DataFrame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打印整个数据框,但是我不想打印索引

I want to print the whole dataframe, but I don't want to print the index

此外,一列是日期时间类型,我只想打印时间,而不是日期.

Besides, one column is datetime type, I just want to print time, not date.

数据框如下:

   User ID           Enter Time   Activity Number
0      123  2014-07-08 00:09:00              1411
1      123  2014-07-08 00:18:00               893
2      123  2014-07-08 00:49:00              1041

我希望它打印为

User ID   Enter Time   Activity Number
123         00:09:00              1411
123         00:18:00               893
123         00:49:00              1041

推荐答案

print df.to_string(index=False)

这篇关于如何在没有索引的情况下打印Pandas DataFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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