Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 运行df.columns后显示所有列_Python_Python 3.x_Pandas_Python 3.6_Labels - Fatal编程技术网

Python 运行df.columns后显示所有列

Python 运行df.columns后显示所有列,python,python-3.x,pandas,python-3.6,labels,Python,Python 3.x,Pandas,Python 3.6,Labels,我的数据框中目前有120列。当我执行 df.columns 我得到一个被截断的列表,其中我只看到20列,而不是120列: Index(['Reporting_FI', 'Reporting_FI_identification', 'Reporting_FI_identification_type', 'Reporting_FI_street_address_1', 'Reporting_FI_street_address_2', 'Reporting_FI_city', '

我的数据框中目前有120列。当我执行

df.columns 
我得到一个被截断的列表,其中我只看到20列,而不是120列:

Index(['Reporting_FI', 'Reporting_FI_identification',
   'Reporting_FI_identification_type', 'Reporting_FI_street_address_1',
   'Reporting_FI_street_address_2', 'Reporting_FI_city',
   'Reporting_FI_state', 'Reporting_FI_postal_code',
   'Reporting_FI_country_code', 'Transaction_date',
   ...
   'FI_country_code_3', 'FI_name_4', 'FI_branch_4', 'FI_identification_4',
   'FI_identification_type_4', 'FI_account_number_4', 'FI_city_4',
   'FI_state_4', 'FI_country_code_4', 'Additional_infomation_2'],
  dtype='object', length=120)
如何调整此设置以显示所有120

我不是在寻找:

pd.set_option('display.max_columns', 120)

谢谢

一个简单的方法是在打印前转换到
列表

res = df.columns.tolist()

print(res)

该死,我怎么没想到呢!非常聪明。谢谢