get first row and second column pandas code example Example: first row as column df df.rename(columns=df.iloc[0])