keep first row as header in pandas dataframe code example Example: first row as column df df.rename(columns=df.iloc[0])