-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REF: rename 'labels' to 'codes' in algorithms.safe_sort and ._factorize #29552
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
Conversation
@@ -468,18 +470,16 @@ def _factorize_array(values, na_sentinel: int = -1, size_hint=None, na_value=Non | |||
|
|||
Returns | |||
------- | |||
labels : ndarray | |||
codes : 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.
do we necessarily know the dtype? e.g. could this be ndarray[int64]
?
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.
As it's implemented, codes will always be of type ndarray[int64]
. I've got a suspicion taht there are cases where would like it to return arrays of fewer bits, but yes, as it is now, it always is an int64 array.
@@ -1924,51 +1924,52 @@ def diff(arr, n: int, axis: int = 0): | |||
# this module. | |||
def safe_sort( | |||
values, | |||
labels=None, | |||
codes=None, |
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.
followup to type this would be great
thanks @topper-123 if you'd like to followup with typing where indicated would be great. |
Finishes up the renaming started by #29509 in
core.algorithms
of 'labels' to 'codes.' Also renames in related tests.