first row as column names python code example
Example 1: promote a row in panda dataframe to header
df.columns = df.iloc[0]
df = df[1:]
Example 2: make first row column names pandas
df.rename(columns=df.iloc[0])
df.columns = df.iloc[0]
df = df[1:]
df.rename(columns=df.iloc[0])