我有一个包含数百列的数据框,我需要查看所有列名。
我做了什么:
In[37]:
data_all2.columns
输出是:
Out[37]:
Index(['customer_id', 'incoming', 'outgoing', 'awan', 'bank', 'family', 'food',
'government', 'internet', 'isipulsa',
...
'overdue_3months_feature78', 'overdue_3months_feature79',
'overdue_3months_feature80', 'overdue_3months_feature81',
'overdue_3months_feature82', 'overdue_3months_feature83',
'overdue_3months_feature84', 'overdue_3months_feature85',
'overdue_3months_feature86', 'loan_overdue_3months_total_y'],
dtype='object', length=102)
如何显示 所有 列,而不是截断列表?
原文由 Nabih Bawazir 发布,翻译遵循 CC BY-SA 4.0 许可协议
您可以全局设置打印选项。我认为这应该有效:
方法一:
方法二:
这将允许您在执行
.head()
时查看所有列名和行。不会截断任何列名。如果您只想查看列名,您可以执行以下操作: