pd rename column names with first row 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])