-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Add use nullable dtypes to read_excel #49091
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
Conversation
# Conflicts: # doc/source/whatsnew/v2.0.0.rst # pandas/io/excel/_base.py # pandas/tests/io/excel/test_readers.py # pandas/tests/io/excel/test_writers.py
This is ready now |
pandas/io/excel/_base.py
Outdated
@@ -271,6 +271,13 @@ | |||
|
|||
.. versionadded:: 1.2.0 | |||
|
|||
use_nullable_dtypes : bool = False |
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.
: bool, default False
here I think.
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.
Done
with tm.ensure_clean(read_ext) as file_path: | ||
df.to_excel(file_path, "test", index=False) | ||
result = pd.read_excel( | ||
file_path, sheet_name="test", use_nullable_dtypes=True, dtype="float64" |
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.
Makes sense to me that dtype overrides use_nullable_dtypes - could you add this to the docstring.
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.
Done
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.
lgtm
Thanks @phofl |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This sits on top of #49089.
Would prefer round tripping during testing instead of adding those files to the repository