new_header = df.iloc[0] #grab the first row for the header
df = df[1:] #take the data less the header row
df.columns = new_header #set the header row as the df header
More Related Contents:
- Python Pandas Replacing Header with Top Row
- Find row where values for column is maximal in a pandas DataFrame
- Pandas dataframe get first row of each group
- Merge multiple column values into one column in python pandas
- How to add header row to a pandas DataFrame
- How do you remove the column name row when exporting a pandas DataFrame?
- Collapsing rows in a Pandas dataframe if all rows have only one value in their columns
- Pandas min() of selected row and columns
- error when applying function to a series object
- How to group dataframe rows into list in pandas groupby
- Groupby value counts on the dataframe pandas
- Pandas: Chained assignments [duplicate]
- Apply pandas function to column to create multiple new columns?
- Reading an Excel file in python using pandas
- Random row selection in Pandas dataframe
- converting currency with $ to numbers in Python pandas
- Lookup Values by Corresponding Column Header in Pandas 1.2.0 or newer
- How to spread a column in a Pandas data frame
- Python Pandas: Boolean indexing on multiple columns [duplicate]
- Vectorized lookup on a pandas dataframe
- Executing an SQL query over a pandas dataset
- Checking if particular value (in cell) is NaN in pandas DataFrame not working using ix or iloc
- Time Series Analysis – unevenly spaced measures – pandas + statsmodels
- Move column by name to front of table in pandas
- matplotlib savefig() size control
- Is there a way to speed up handling large CSVs and dataframes in python?
- pandas convert from datetime to integer timestamp
- mean from pandas and numpy differ
- Replace NaN with empty list in a pandas dataframe
- When is it appropriate to use df.value_counts() vs df.groupby(‘…’).count()?