【问题标题】:displaying columns names of dataFrame in python [duplicate]在python中显示dataFrame的列名[重复]
【发布时间】:2021-05-17 21:56:20
【问题描述】:

我有一个大约 100 列的 xlsx 文件。当我使用df.columns 函数时,它会显示一些第一列和一些最后一列,但不是全部。我想通过 for 循环显示(打印)所有列名(标题)。我该怎么做?

【问题讨论】:

标签: python pandas dataframe


【解决方案1】:
for col in df.columns:
    print(col)

【讨论】:

    猜你喜欢
    • 2020-07-30
    • 2019-08-05
    • 2020-02-26
    • 2019-07-21
    • 2021-12-18
    • 2020-06-06
    • 2013-09-27
    • 2021-07-15
    相关资源
    最近更新 更多