Skip to content

DTA/TDA/PA inplace methods should actually be inplace #24115

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

Closed
jbrockmendel opened this issue Dec 5, 2018 · 2 comments · Fixed by #30505
Closed

DTA/TDA/PA inplace methods should actually be inplace #24115

jbrockmendel opened this issue Dec 5, 2018 · 2 comments · Fixed by #30505
Assignees
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Bug Datetime Datetime data dtype
Milestone

Comments

@jbrockmendel
Copy link
Member

At the moment we are using the implementations designed for Index subclasses, which return new objects.

@gfyoung
Copy link
Member

gfyoung commented Dec 6, 2018

@jbrockmendel : For the rest of us, do you mind sharing an example of what you mean? 🙂

@gfyoung gfyoung added Datetime Datetime data dtype Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff labels Dec 6, 2018
@jbrockmendel
Copy link
Member Author

>>> dti = pd.date_range('2016-01-01', periods=3)
>>> dta = pd.core.arrays.DatetimeArrayMixin(dti)
>>> orig = dta
>>> dta -= dti[0]
>>> dta is orig
False

in-place operation should preserve identity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants