Skip to content

TYP: some types for pandas/core/arrays/base.py #29968

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions pandas/core/arrays/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,9 @@ def _values_for_argsort(self) -> np.ndarray:
# Note: this is used in `ExtensionArray.argsort`.
return np.array(self)

def argsort(self, ascending=True, kind="quicksort", *args, **kwargs):
def argsort(
self, ascending: bool = True, kind: str = "quicksort", *args, **kwargs
) -> np.ndarray:
"""
Return the indices that would sort this array.

Expand All @@ -467,7 +469,7 @@ def argsort(self, ascending=True, kind="quicksort", *args, **kwargs):

Returns
-------
index_array : ndarray
ndarray
Array of indices that sort ``self``. If NaN values are contained,
NaN values are placed at the end.

Expand Down Expand Up @@ -1198,10 +1200,9 @@ def _maybe_convert(arr):

if op.__name__ in {"divmod", "rdivmod"}:
a, b = zip(*res)
res = _maybe_convert(a), _maybe_convert(b)
else:
res = _maybe_convert(res)
return res
return _maybe_convert(a), _maybe_convert(b)

return _maybe_convert(res)

op_name = ops._get_op_name(op, True)
return set_function_name(_binop, op_name, cls)
Expand Down