Skip to content

Commit f4ad00b

Browse files
simonjayhawkinsproost
authored andcommitted
TYPE: some types for pandas/core/arrays/base.py (pandas-dev#29968)
1 parent 5b541ba commit f4ad00b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pandas/core/arrays/base.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,9 @@ def _values_for_argsort(self) -> np.ndarray:
451451
# Note: this is used in `ExtensionArray.argsort`.
452452
return np.array(self)
453453

454-
def argsort(self, ascending=True, kind="quicksort", *args, **kwargs):
454+
def argsort(
455+
self, ascending: bool = True, kind: str = "quicksort", *args, **kwargs
456+
) -> np.ndarray:
455457
"""
456458
Return the indices that would sort this array.
457459
@@ -467,7 +469,7 @@ def argsort(self, ascending=True, kind="quicksort", *args, **kwargs):
467469
468470
Returns
469471
-------
470-
index_array : ndarray
472+
ndarray
471473
Array of indices that sort ``self``. If NaN values are contained,
472474
NaN values are placed at the end.
473475
@@ -1198,10 +1200,9 @@ def _maybe_convert(arr):
11981200

11991201
if op.__name__ in {"divmod", "rdivmod"}:
12001202
a, b = zip(*res)
1201-
res = _maybe_convert(a), _maybe_convert(b)
1202-
else:
1203-
res = _maybe_convert(res)
1204-
return res
1203+
return _maybe_convert(a), _maybe_convert(b)
1204+
1205+
return _maybe_convert(res)
12051206

12061207
op_name = ops._get_op_name(op, True)
12071208
return set_function_name(_binop, op_name, cls)

0 commit comments

Comments
 (0)