Priyansh Saxena commited on
Commit
e6c30af
·
1 Parent(s): ea534aa

fix: add xlrd for .xls support, use explicit engine in read_excel

Browse files
Files changed (2) hide show
  1. data_processor.py +4 -2
  2. requirements.txt +1 -0
data_processor.py CHANGED
@@ -17,8 +17,10 @@ class DataProcessor:
17
  try:
18
  if ext == '.csv':
19
  data = pd.read_csv(path)
20
- elif ext in ['.xls', '.xlsx']:
21
- data = pd.read_excel(path)
 
 
22
  else:
23
  raise ValueError(f"Unsupported file type: {ext}")
24
  logging.info(f"Loaded data from {path} with shape {data.shape}")
 
17
  try:
18
  if ext == '.csv':
19
  data = pd.read_csv(path)
20
+ elif ext == '.xls':
21
+ data = pd.read_excel(path, engine='xlrd')
22
+ elif ext == '.xlsx':
23
+ data = pd.read_excel(path, engine='openpyxl')
24
  else:
25
  raise ValueError(f"Unsupported file type: {ext}")
26
  logging.info(f"Loaded data from {path} with shape {data.shape}")
requirements.txt CHANGED
@@ -39,6 +39,7 @@ numpy
39
  openai>=1.0.0
40
  openpyxl
41
  optimum
 
42
  packaging
43
  pandas
44
  pillow
 
39
  openai>=1.0.0
40
  openpyxl
41
  optimum
42
+ xlrd>=2.0.1
43
  packaging
44
  pandas
45
  pillow