如何打印没有索引的数据帧 [英] how to print dataframe without index

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

问题描述

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

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

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

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)

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

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