Skip to content
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 inplace param in MultiIndex.set_codes and MultiIndex.set_levels #35626

Merged
merged 5 commits into from
Aug 10, 2020

Conversation

topper-123
Copy link
Contributor

Deprecates inplace parameter in MultiIndex.set_codes and MultiIndex.set_levels.

Allowing inplace ops in indexes makes them more complicated wtr. caching etc. After inplace is removed, MultiIndex will be immutable, except the names attribute, similarly to other index classes.

@topper-123 topper-123 changed the title DEPR: Deprecate inplace param in MultiIndex.set_codes and MultiIndex.set_codes DEPR: Deprecate inplace param in MultiIndex.set_codes and MultiIndex.set_levels Aug 8, 2020
@jreback jreback added Deprecate Functionality to remove in pandas MultiIndex labels Aug 8, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comment, can you add this to the deprecation issue: #30228

to set these attributes directly. They default to returning a copy; however,
you can specify ``inplace=True`` to have the data change in place.
``name`` attribute. You can use the ``rename``, ``set_names`` to set these attributes
directly. They default to returning a copy; however, you can specify ``inplace=True`` to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove the inplace ref

@topper-123
Copy link
Contributor Author

Updated.

@jreback jreback added this to the 1.2 milestone Aug 10, 2020
@@ -898,7 +909,7 @@ def _set_codes(
self._tuples = None
self._reset_cache()

def set_codes(self, codes, level=None, inplace=False, verify_integrity=True):
def set_codes(self, codes, level=None, inplace=None, verify_integrity=True):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typing these would be good at some point

@jreback jreback merged commit 5dee73b into pandas-dev:master Aug 10, 2020
@jreback
Copy link
Contributor

jreback commented Aug 10, 2020

thanks @topper-123

@topper-123 topper-123 deleted the deprecate_MultiIndex_inplace branch August 10, 2020 17:52
maxwell-k added a commit to maxwell-k/qgridtrusted that referenced this pull request Jan 12, 2024
maxwell-k added a commit to maxwell-k/qgridtrusted that referenced this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas MultiIndex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants