-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppressing XLRD warnings #16620
Comments
I think the proper solution is for xlrd to use the logging module. There's an issue here, if you want to resurrect it, or maybe submit a PR to xlrd. In the meantime, does opening the workbook your self manually, and passing that to Something like
|
It does the trick for me! |
|
Pls forgive the necrobumping here ☠️🤛 update for 2019:
|
Shouldn't this be |
The solution provided above redirects standard error outputs to null device, import os
import pandas as pd
import xlrd
wb = xlrd.open_workbook('file.xlsx', logfile=open(os.devnull, 'w'))
pd.read_excel(wb, engine='xlrd') |
Hello,
I would like to suppress some warnings from the xlrd module that appears when calling the pd.read_excel function
These are my typical warnings:
WARNING *** file size (608105) not 512 + multiple of sector size (512)
WARNING *** OLE2 inconsistency: SSCS size is 0 but SSAT size is non-zero
One of the solutions to this problem that I see on the web is to filter those via a log filter, see:
https://stackoverflow.com/questions/7619319/python-xlrd-suppress-warning-messages
But that would require having access to specify the logger in the read_excel function arguments.
Or is there another solution ?
Thanks,
Loic
The text was updated successfully, but these errors were encountered: