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
df = pd.read_excel("test.xlsx")
Issue Description
df = pd.read_excel("test.xlsx")
Is working as expected in that df
is correct, but it is printing to screen a subset of the sheet names contained in "test.xlsx". e.g.
mysheetname 3
mysheetname 4
If, in Excel, I delete the entire contents of mysheetname 3
its name is still printed out when running read_excel
. If I delete the worksheet, then create a new one with the same name, it no longer is printed to screen. So presumably these sheets contain something weird that is causing read_excel
to print the sheet name to screen.
Expected Behavior
df = pd.read_excel("test.xlsx")
does not print to screen a subset of the sheet names in my workbook.
Installed Versions
Comment From: rhshadrach
Thanks for the report - does this happen with all Excel files? Can you provide a reproducible example? I would be helpful if the example created the DataFrame from code, wrote it out to test.xlsx
, and then read in. However, if this isn't possible, then sharing a small Excel file would work as well.
I would also suggest checking that the installation of your libraries is clean - i.e. that no one has added print calls in pandas or the Excel reading engine. I myself have been guilty of doing then when debugging on rare occasions :laughing:
Comment From: asishm
probably same issue as #51161
Comment From: rhshadrach
Thanks @asishm - Looks like this was reported and close to getting fixed: https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1978
Comment From: rhshadrach
Closing