Skip to content
Advertisement

Replacing Header with Top Row

I currently have a dataframe that looks like this:

JavaScript

I’m looking for a way to delete the header row and make the first row the new header row, so the new dataframe would look like this:

JavaScript

I’ve tried stuff along the lines of if 'Unnamed' in df.columns: then make the dataframe without the header

JavaScript

but I don’t seem to be getting anywhere.

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement