convert first row to column names in pandas code example Example: first row as column df df.rename(columns=df.iloc[0])