Pandas version checks

  • [x] I have checked that this issue has not already been reported.

  • [x] I have confirmed this bug exists on the latest version of pandas.

  • [ ] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
df = pd.read_excel("test_data/test.xlsx", sheet_name=None)
print(type(df))

Issue Description

Function pandas.read_excel when parameter sheet_name is set to None return dict object apart from pandas.core.frame.DataFrame.

Expected Behavior

It should return DF

Installed Versions

pandas==2.2.3

Comment From: Filip-Regenczuk

Important - it returns dict of DFs, what is not specified in documentation. It is misleading if excel file has only one sheet.

Comment From: asishm

Thanks for the report. This is intended. sheet_name=None will return always dict of dataframes (the docs do state that the read_excel method can return a dict of dataframes depending on the sheet_name parameter - which in turn states that using None would return ALL dataframes)

Relabeling as a docs request to maybe make this explicit in the docs.

Comment From: rhshadrach

I think adding something like "When None, will return a dictionary containing DataFrames for each sheet" to the description of the sheets argument would be welcome!

It is misleading if excel file has only one sheet.

I think you're suggesting that pandas should return a DataFrame in the case where sheets=None and there is only one sheet in the Excel file. I am negative on making this change. The return type should be predictable from the arguments, and not depend on the data.