我有一個(gè)dataframe,有167列。當(dāng)我打印df.columns
時(shí),它在列表中顯示...
,表示某些列已從打印中折疊。
I tried
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
但這無(wú)濟(jì)于事。如何顯示所有列?
我有一個(gè)dataframe,有167列。當(dāng)我打印df.columns
時(shí),它在列表中顯示...
,表示某些列已從打印中折疊。
I tried
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
但這無(wú)濟(jì)于事。如何顯示所有列?
公眾號(hào):1024技術(shù)圈
?? 提供互聯(lián)網(wǎng)知識(shí)和資訊,分享IT前沿技術(shù),熱門(mén)資源,大廠面試題 ??
這是由
display.max_seq_items
參數(shù)控制的。如果您鍵入:您可以看到可用的參數(shù)及其描述。對(duì)于這個(gè):
因此,為了按
print(df.columns)
顯示所有列,您必須指定:或者,輸出一個(gè)打印不受Pandas控制的列表: