-1

I need to import .XLSX Excel file into pandas it is now unsupported and gives the error

XLRDError: Excel xlsx file; not supported

I need an alternative for:

import pandas as pd

df = pd.read_excel("Challenger track/Data Sets/extract-text-1.xlsx", index_col=0)
df.head()
pakpe
  • 5,391
  • 2
  • 8
  • 23
  • It did answer my question YES, the problem with StackOverflow now is the structure of question may defer from a person to another and the number of results may lead that I won't scroll 500 results for example but thank you so much for referring to that answer – Kareem Alaraby May 12 '21 at 19:08

1 Answers1

2

This is the workaround for pandas not supporting xlsx files. Install openpyxl and specify it as the engine when reading an xlsx file as below:

xlfile = pd.ExcelFile('sample.xlsx', engine='openpyxl')
df = xlfile.parse('sheet_name')
pakpe
  • 5,391
  • 2
  • 8
  • 23