Skip to content

Commit 40cc0d7

Browse files
ShaharNavehproost
authored andcommitted
DOC: Cleaned pandas/_libs/algos.pyx docstrings (pandas-dev#30155)
1 parent a7ca730 commit 40cc0d7

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

pandas/_libs/algos.pyx

+14-13
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ cdef inline bint are_diff(object left, object right):
4949

5050

5151
class Infinity:
52-
""" provide a positive Infinity comparison method for ranking """
53-
52+
"""
53+
Provide a positive Infinity comparison method for ranking.
54+
"""
5455
__lt__ = lambda self, other: False
5556
__le__ = lambda self, other: isinstance(other, Infinity)
5657
__eq__ = lambda self, other: isinstance(other, Infinity)
@@ -61,8 +62,9 @@ class Infinity:
6162

6263

6364
class NegInfinity:
64-
""" provide a negative Infinity comparison method for ranking """
65-
65+
"""
66+
Provide a negative Infinity comparison method for ranking.
67+
"""
6668
__lt__ = lambda self, other: (not isinstance(other, NegInfinity) and
6769
not missing.checknull(other))
6870
__le__ = lambda self, other: not missing.checknull(other)
@@ -158,20 +160,19 @@ def groupsort_indexer(const int64_t[:] index, Py_ssize_t ngroups):
158160
Parameters
159161
----------
160162
index: int64 ndarray
161-
mappings from group -> position
163+
Mappings from group -> position.
162164
ngroups: int64
163-
number of groups
165+
Number of groups.
164166
165167
Returns
166168
-------
167169
tuple
168-
1-d indexer ordered by groups, group counts
170+
1-d indexer ordered by groups, group counts.
169171
170172
Notes
171173
-----
172174
This is a reverse of the label factorization process.
173175
"""
174-
175176
cdef:
176177
Py_ssize_t i, loc, label, n
177178
ndarray[int64_t] counts, where, result
@@ -679,7 +680,9 @@ def is_monotonic(ndarray[algos_t, ndim=1] arr, bint timelike):
679680
Returns
680681
-------
681682
tuple
682-
is_monotonic_inc, is_monotonic_dec, is_unique
683+
is_monotonic_inc : bool
684+
is_monotonic_dec : bool
685+
is_unique : bool
683686
"""
684687
cdef:
685688
Py_ssize_t i, n
@@ -774,9 +777,8 @@ ctypedef fused rank_t:
774777
def rank_1d(rank_t[:] in_arr, ties_method='average',
775778
ascending=True, na_option='keep', pct=False):
776779
"""
777-
Fast NaN-friendly version of scipy.stats.rankdata
780+
Fast NaN-friendly version of ``scipy.stats.rankdata``.
778781
"""
779-
780782
cdef:
781783
Py_ssize_t i, j, n, dups = 0, total_tie_count = 0, non_na_idx = 0
782784

@@ -995,9 +997,8 @@ def rank_1d(rank_t[:] in_arr, ties_method='average',
995997
def rank_2d(rank_t[:, :] in_arr, axis=0, ties_method='average',
996998
ascending=True, na_option='keep', pct=False):
997999
"""
998-
Fast NaN-friendly version of scipy.stats.rankdata
1000+
Fast NaN-friendly version of ``scipy.stats.rankdata``.
9991001
"""
1000-
10011002
cdef:
10021003
Py_ssize_t i, j, z, k, n, dups = 0, total_tie_count = 0
10031004

0 commit comments

Comments
 (0)