Skipping Rows When Importing an Excel Sheet with Pandas

Python

 1|  import pandas as pd
 2|  
 3|  # skip the first 5 rows
 4|  df = pd.read_excel('Returns.xlsx', sheet_name='Returns', skiprows=4)
 5|  
 6|  # skip the 1st and 3rd rows
 7|  df = pd.read_excel('Returns.xlsx', sheet_name='Returns', skiprows=[0,2])
Did you find this snippet useful?

Sign up for free to to add this to your code library