-
-
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
CLN: remove _ndarray_values #32768
CLN: remove _ndarray_values #32768
Conversation
pandas/core/arrays/categorical.py
Outdated
@@ -2570,8 +2566,7 @@ def _get_codes_for_values(values, categories): | |||
if dtype_equal: | |||
# To prevent erroneous dtype coercion in _get_data_algo, retrieve | |||
# the underlying numpy array. gh-22702 | |||
values = getattr(values, "_ndarray_values", values) | |||
categories = getattr(categories, "_ndarray_values", categories) | |||
pass |
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.
This is nice on a first pass at the diff, but probably better just to blow this branch away
pandas/core/indexes/base.py
Outdated
@@ -623,7 +622,10 @@ def ravel(self, order="C"): | |||
-------- | |||
numpy.ndarray.ravel | |||
""" | |||
return self._ndarray_values.ravel(order=order) | |||
values = self._values | |||
if not isinstance(values, np.ndarray): |
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.
Is there not a more generic way to accomplish this?
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.
lgtm
boom! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff