Get a list from Pandas DataFrame column headers

You can get the values as a list by doing:

list(my_dataframe.columns.values)

Also you can simply use (as shown in Ed Chum’s answer):

list(my_dataframe)

Leave a Comment

error code: 523