Answers for "print the column names of a dataframe"

10

df change column names

df.rename(columns={"A": "a", "B": "b", "C": "c"},
errors="raise", inplace=True)
Posted by: Guest on March-12-2020
7

pd dataframe get column names

lst = data.columns.values     # data is dataframe
Posted by: Guest on April-27-2020
-1

dataframe names pandas

print(df.rename(columns={'A': 'a', 'C': 'c'}))
Posted by: Guest on November-24-2020

Code answers related to "print the column names of a dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language