"usecols" should help, use range of columns (as per excel worksheet, A,B...etc.) below are the examples
- Selected Columns
df = pd.read_excel(file_location,sheet_name='Sheet1', usecols="A,C,F")
- Range of Columns and selected column
df = pd.read_excel(file_location,sheet_name='Sheet1', usecols="A:F,H")
- Multiple Ranges
df = pd.read_excel(file_location,sheet_name='Sheet1', usecols="A:F,H,J:N")
- Range of columns
df = pd.read_excel(file_location,sheet_name='Sheet1', usecols="A:N")
Top comments (0)