pandas list header names code example
Example 1: pd dataframe get column names
lst = data.columns.values # data is dataframe
Example 2: dataframe names pandas
print(df.rename(columns={'A': 'a', 'C': 'c'}))
lst = data.columns.values # data is dataframe
print(df.rename(columns={'A': 'a', 'C': 'c'}))