-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
DEPR: deprecate dtype param in Index.copy #35853
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: deprecate dtype param in Index.copy #35853
Conversation
| name=lib.no_default, | ||
| levels=None, | ||
| codes=None, | ||
| dtype=None, |
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.
Other index types don't have dtype param in their _shallow_copy signature. Instead do dtype changing inside MultiIndex.copy.
pandas/core/indexes/base.py
Outdated
| if dtype: | ||
| warnings.warn( | ||
| "parameter dtype is deprecated and will be removed in a future version." | ||
| " Use the astype method instead.", |
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.
looks like linter wants the whitespace in the previous line
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.
Yeah, fixed.
d5be44c to
a828666
Compare
|
thanks @topper-123 |
Deprecate
dtypeparam inIndex.copyand child methods. If users want to change dtype, they should useIndex.astype.