Grace C. answered 10/18/19
Tutor
5
(99)
Software Engineer (20 Years of Experience) w. PhD in Mathematics
If you have a pandas DataFrame named df, you can get the column headers by
>> df.columns
This return a pandas Index object.
If you want to save it as a Python list to header_list:
>> header_list = list(df.columns)