Skip to content

Commit 7acf607

Browse files
ShaharNavehTomAugspurger
authored andcommitted
DOC: Improving the algos docs (#29449)
1 parent f590cea commit 7acf607

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

pandas/_libs/algos.pyx

+17-7
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ cpdef ndarray[int64_t, ndim=1] unique_deltas(const int64_t[:] arr):
8484
8585
Returns
8686
-------
87-
result : ndarray[int64_t]
88-
result is sorted
87+
ndarray[int64_t]
88+
An ordered ndarray[int64_t]
8989
"""
9090
cdef:
9191
Py_ssize_t i, n = len(arr)
@@ -150,9 +150,10 @@ def is_lexsorted(list_of_arrays: list) -> bint:
150150
@cython.wraparound(False)
151151
def groupsort_indexer(const int64_t[:] index, Py_ssize_t ngroups):
152152
"""
153-
compute a 1-d indexer that is an ordering of the passed index,
154-
ordered by the groups. This is a reverse of the label
155-
factorization process.
153+
Compute a 1-d indexer.
154+
155+
The indexer is an ordering of the passed index,
156+
ordered by the groups.
156157
157158
Parameters
158159
----------
@@ -161,7 +162,14 @@ def groupsort_indexer(const int64_t[:] index, Py_ssize_t ngroups):
161162
ngroups: int64
162163
number of groups
163164
164-
return a tuple of (1-d indexer ordered by groups, group counts)
165+
Returns
166+
-------
167+
tuple
168+
1-d indexer ordered by groups, group counts
169+
170+
Notes
171+
-----
172+
This is a reverse of the label factorization process.
165173
"""
166174

167175
cdef:
@@ -391,6 +399,7 @@ def _validate_limit(nobs: int, limit=None) -> int:
391399
Returns
392400
-------
393401
int
402+
The limit.
394403
"""
395404
if limit is None:
396405
lim = nobs
@@ -669,7 +678,8 @@ def is_monotonic(ndarray[algos_t, ndim=1] arr, bint timelike):
669678
"""
670679
Returns
671680
-------
672-
is_monotonic_inc, is_monotonic_dec, is_unique
681+
tuple
682+
is_monotonic_inc, is_monotonic_dec, is_unique
673683
"""
674684
cdef:
675685
Py_ssize_t i, n

0 commit comments

Comments
 (0)