python pd dataframe from records remove header

Solutions on MaxInterview for python pd dataframe from records remove header by the best coders in the world

showing results for - "python pd dataframe from records remove header"
Simon
21 Jun 2016
1df.rename(columns=df.iloc[0]).drop(df.index[0])
2
Shana
23 Oct 2016
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
4