Hi everyone. I’m quite new to JupyterLab and am doing an introductory Python course. However I need to do something work-related that requires to import some data stored in an Excel file. I’ve dragged and dropped the .xlsx file into the working folder (just where the .ipynb is) and have done the following:
import pandas as pd
dataset = pd.read_excel(“XL_test.xlsx”)
(My Excel file is quite vasic, with 3 columns and a bit over 500 rows, starting on cell A1)
However I consistently get an error:
ValueError Traceback (most recent call last)
Cell In[51], line 1
----> 1 dataset = pd.read_excel(“XL_test.xlsx”)
File /lib/python3.11/site-packages/pandas/util/_decorators.py:211, in deprecate_kwarg.._deprecate_kwarg..wrapper(*args, **kwargs)
209 else:
210 kwargs[new_arg_name] = new_arg_value
→ 211 return func(*args, **kwargs)
File /lib/python3.11/site-packages/pandas/util/_decorators.py:331, in deprecate_nonkeyword_arguments..decorate..wrapper(*args, **kwargs)
325 if len(args) > num_allow_args:
326 warnings.warn(
327 msg.format(arguments=_format_argument_list(allow_args)),
328 FutureWarning,
329 stacklevel=find_stack_level(),
330 )
→ 331 return func(*args, **kwargs)
File /lib/python3.11/site-packages/pandas/io/excel/_base.py:482, in read_excel(io, sheet_name, header, names, index_col, usecols, squeeze, dtype, engine, converters, true_values, false_values, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, parse_dates, date_parser, thousands, decimal, comment, skipfooter, convert_float, mangle_dupe_cols, storage_options)
480 if not isinstance(io, ExcelFile):
481 should_close = True
→ 482 io = ExcelFile(io, storage_options=storage_options, engine=engine)
483 elif engine and engine != io.engine:
484 raise ValueError(
485 "Engine should not be specified when passing "
486 “an ExcelFile - ExcelFile already has the engine set”
487 )
File /lib/python3.11/site-packages/pandas/io/excel/_base.py:1656, in ExcelFile.init(self, path_or_buffer, engine, storage_options)
1652 ext = inspect_excel_format(
1653 content_or_path=path_or_buffer, storage_options=storage_options
1654 )
1655 if ext is None:
→ 1656 raise ValueError(
1657 “Excel file format cannot be determined, you must specify "
1658 “an engine manually.”
1659 )
1661 engine = config.get_option(f"io.excel.{ext}.reader”, silent=True)
1662 if engine == “auto”:
ValueError: Excel file format cannot be determined, you must specify an engine manually.
It appears to return an error related to the extension. I guess I’ve read something about an Excel engine, but my attempts were unsuccessful.
Anyone can help, please?