how to set first line to header df pands code example Example: first row as column df df.rename(columns=df.iloc[0])