python dataframe remove header

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

showing results for - "python dataframe remove header"
Arthur
21 Mar 2016
1df.rename(columns=df.iloc[0]).drop(df.index[0])
2
Federica
08 May 2018
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