-
-
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: Deprecate inplace param in MultiIndex.set_codes and MultiIndex.set_levels #35626
DEPR: Deprecate inplace param in MultiIndex.set_codes and MultiIndex.set_levels #35626
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.
small comment, can you add this to the deprecation issue: #30228
doc/source/user_guide/indexing.rst
Outdated
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 |
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.
you can remove the inplace ref
Updated. |
eb5cf1a
to
71c1be9
Compare
@@ -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): |
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.
typing these would be good at some point
thanks @topper-123 |
This argument was deprecated in Pandas 1.2 and removed in 2.0 https://pandas.pydata.org/pandas-docs/version/1.5/reference/api/pandas.MultiIndex.set_levels.html pandas-dev/pandas#35626
This argument was deprecated in Pandas 1.2 and removed in 2.0 https://pandas.pydata.org/pandas-docs/version/1.5/reference/api/pandas.MultiIndex.set_levels.html pandas-dev/pandas#35626
Deprecates
inplace
parameter inMultiIndex.set_codes
andMultiIndex.set_levels
.Allowing inplace ops in indexes makes them more complicated wtr. caching etc. After
inplace
is removed,MultiIndex
will be immutable, except thenames
attribute, similarly to other index classes.