Select the Header Row When Importing an Excel file with Pandas

Import and Export

We can tell Pandas which row to use for the headers when we import an excel spreadsheet by a row index to the "header" parameter.

In this example, the header we want to use is located in the third row.

 1|  import pandas as pd
 3|  df = pd.read_excel('Returns.xlsx', sheet_name='Returns', header=2)
1 Upvote
Tags: Read_excel | Excel
Did you find this snippet useful?

Sign up to bookmark this in your snippet library