make first row columns pandas

Solutions on MaxInterview for make first row columns pandas by the best coders in the world

showing results for - "make first row columns pandas"
Aidan
30 Jan 2020
1new_header = df.iloc[0] #grab the first row for the header
2df = df[1:] #take the data less the header row
3df.columns = new_header #set the header row as the df header