-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
DEPR: xlwt for writing excel files #38317
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
doc/source/user_guide/io.rst
Outdated
The `xlwt <https://pypi.org/project/xlwt/>`__ | ||
engine, the only engine that supports writing | ||
in an xls format, is no longer maintained and | ||
will be removed in a future version of pandas. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: it's the package that is no longer maintained, and the engine that will be removed (now it reads like the code in pandas that will be removed is no longer maintained)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(now, since it's written this way in many places in your PR (and the previous one), it might not be worth it to change ..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the nitpicks; and as long as it's not holding things up happy to work on it to get it right. What do you think of:
The
`xlwt <https://pypi.org/project/xlwt/>`__
package is no longer maintained and will not be available in a future version of pandas. This is the only engine currently in pandas that supports writing in an xls format.
pandas/io/excel/_base.py
Outdated
"an xls format, is no longer maintained and will be removed in " | ||
"a future version of pandas. Install openpyxl and write to an " | ||
"xlsx file instead. You can set the option " | ||
"io.excel.xls.writer to 'xlwt' to silence this warning.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But setting the option is also deprecated and will also raise a warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - but at least it is in hopefully fewer places in user code. The warning can still be ignored there, but I see now that will cause confusion when a user follows the instruction and then still gets a warning. I'm thinking I'll change to:
You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. This option is deprecated as well and will also give a warning, but can be globally set and suppressed.
looks ok to me (ex text comments). ping when revised. |
Thanks @jorisvandenbossche and @jreback, changes made. I also updated the screenshot in the OP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates!
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Deprecates both specifying
engine="xlwt"
and the optionio.excel.xls.writer
. Note that a warning is emitted when a user sets theio.excel.xls.writer
option, but not via the context manager. Whatsnew now reads: