How to make first row as column names of DataFrame?

I want to delete all the column names and need to make the first row i.e TIMEFRAME, SURJEK_FLOW_METER_2 ,.... names as column names.Can anyone help me with the ideas or small snippets. Thank you in advance.

new_header = df1.iloc[0] #grab the first row for the header
df1 = df1[1:] #take the data less the header row
df1.columns = new_header #set the header row as the df header

Try this:)

1 Like

It works perfectly.Thank you very much mate…

1 Like