@@ -49,8 +49,9 @@ cdef inline bint are_diff(object left, object right):
49
49
50
50
51
51
class Infinity :
52
- """ provide a positive Infinity comparison method for ranking """
53
-
52
+ """
53
+ Provide a positive Infinity comparison method for ranking.
54
+ """
54
55
__lt__ = lambda self , other : False
55
56
__le__ = lambda self , other : isinstance (other, Infinity)
56
57
__eq__ = lambda self , other : isinstance (other, Infinity)
@@ -61,8 +62,9 @@ class Infinity:
61
62
62
63
63
64
class NegInfinity :
64
- """ provide a negative Infinity comparison method for ranking """
65
-
65
+ """
66
+ Provide a negative Infinity comparison method for ranking.
67
+ """
66
68
__lt__ = lambda self , other : (not isinstance (other, NegInfinity) and
67
69
not missing.checknull(other))
68
70
__le__ = lambda self , other : not missing.checknull(other)
@@ -158,20 +160,19 @@ def groupsort_indexer(const int64_t[:] index, Py_ssize_t ngroups):
158
160
Parameters
159
161
----------
160
162
index: int64 ndarray
161
- mappings from group -> position
163
+ Mappings from group -> position.
162
164
ngroups: int64
163
- number of groups
165
+ Number of groups.
164
166
165
167
Returns
166
168
-------
167
169
tuple
168
- 1-d indexer ordered by groups, group counts
170
+ 1-d indexer ordered by groups, group counts.
169
171
170
172
Notes
171
173
-----
172
174
This is a reverse of the label factorization process.
173
175
"""
174
-
175
176
cdef:
176
177
Py_ssize_t i, loc, label, n
177
178
ndarray[int64_t] counts, where, result
@@ -679,7 +680,9 @@ def is_monotonic(ndarray[algos_t, ndim=1] arr, bint timelike):
679
680
Returns
680
681
-------
681
682
tuple
682
- is_monotonic_inc, is_monotonic_dec, is_unique
683
+ is_monotonic_inc : bool
684
+ is_monotonic_dec : bool
685
+ is_unique : bool
683
686
"""
684
687
cdef:
685
688
Py_ssize_t i, n
@@ -774,9 +777,8 @@ ctypedef fused rank_t:
774
777
def rank_1d (rank_t[:] in_arr , ties_method = ' average' ,
775
778
ascending = True , na_option = ' keep' , pct = False ):
776
779
"""
777
- Fast NaN-friendly version of scipy.stats.rankdata
780
+ Fast NaN-friendly version of `` scipy.stats.rankdata``.
778
781
"""
779
-
780
782
cdef:
781
783
Py_ssize_t i, j, n, dups = 0 , total_tie_count = 0 , non_na_idx = 0
782
784
@@ -995,9 +997,8 @@ def rank_1d(rank_t[:] in_arr, ties_method='average',
995
997
def rank_2d (rank_t[:, :] in_arr , axis = 0 , ties_method = ' average' ,
996
998
ascending = True , na_option = ' keep' , pct = False ):
997
999
"""
998
- Fast NaN-friendly version of scipy.stats.rankdata
1000
+ Fast NaN-friendly version of `` scipy.stats.rankdata``.
999
1001
"""
1000
-
1001
1002
cdef:
1002
1003
Py_ssize_t i, j, z, k, n, dups = 0 , total_tie_count = 0
1003
1004
0 commit comments