-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: remove FrozenNDarray #29840
DEPR: remove FrozenNDarray #29840
Conversation
doc/source/whatsnew/v1.0.0.rst
Outdated
@@ -433,6 +433,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more. | |||
- Removed previously deprecated :func:`pandas.tseries.plotting.tsplot` (:issue:`18627`) | |||
- Removed the previously deprecated ``reduce`` and ``broadcast`` arguments from :meth:`DataFrame.apply` (:issue:`18577`) | |||
- Removed the previously deprecated ``assert_raises_regex`` function in ``pandas.util.testing`` (:issue:`29174`) | |||
- Removed the previously deprecated ``FrozenNDArray`` class in ``pandas.core.indexes.frozen`` (:issue:`29335`) |
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.
extra space
pandas/core/indexes/multi.py
Outdated
@@ -810,6 +811,13 @@ def set_levels(self, levels, level=None, inplace=False, verify_integrity=True): | |||
def codes(self): | |||
return self._codes | |||
|
|||
def _coerce(self, array_like, categories, copy=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.
can you make this a free function, add types & a doc-string
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.
nice lgtm. Thanks for picking this up!
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 request, rebase (i know need to rebase almost all.....)
rebased+green |
@@ -1095,7 +1094,8 @@ def _format_native_types(self, na_rep="nan", **kwargs): | |||
if mask.any(): | |||
nan_index = len(level) | |||
level = np.append(level, na_rep) | |||
level_codes = level_codes.values() | |||
assert not level_codes.flags.writeable # i.e. copy is needed |
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.
shoulnt' you be calling _coerce_indexer_frozen here (with copy=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.
no, _coerce_indexer_frozen returns an ndarrary that is not writeable, whereas here we have a non-writeable ndarray and need to get a writeable copy
thanks @jbrockmendel |
Reboots #29335.