You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Pandas version checks
I have checked that this issue has not already been reported.
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
Issue Description
Function
pandas.read_excel
when parametersheet_name
is set toNone
return dict object apart frompandas.core.frame.DataFrame
.Expected Behavior
It should return DF
Installed Versions
pandas==2.2.3
The text was updated successfully, but these errors were encountered: