@@ -24,7 +24,7 @@ dtypes = [('object', 'object', 'Infinity()', 'NegInfinity()'),
2424
2525@cython.wraparound(False)
2626@cython.boundscheck(False)
27- def rank_1d_{{dtype}}(object in_arr, ties_method='average',
27+ def rank_1d_{{dtype}}({{ctype}}[:] in_arr, ties_method='average',
2828 ascending=True, na_option='keep', pct=False):
2929 """
3030 Fast NaN-friendly version of scipy.stats.rankdata
@@ -189,7 +189,7 @@ def rank_1d_{{dtype}}(object in_arr, ties_method='average',
189189 return ranks
190190
191191
192- def rank_2d_{{dtype}}(object in_arr, axis=0, ties_method='average',
192+ def rank_2d_{{dtype}}({{ctype}}[:, :] in_arr, axis=0, ties_method='average',
193193 ascending=True, na_option='keep', pct=False):
194194 """
195195 Fast NaN-friendly version of scipy.stats.rankdata
@@ -226,12 +226,10 @@ def rank_2d_{{dtype}}(object in_arr, axis=0, ties_method='average',
226226
227227 keep_na = na_option == 'keep'
228228
229- in_arr = np.asarray(in_arr)
230-
231229 if axis == 0:
232- values = in_arr.T.copy()
230+ values = np.asarray( in_arr) .T.copy()
233231 else:
234- values = in_arr.copy()
232+ values = np.asarray( in_arr) .copy()
235233
236234 {{if dtype == 'object'}}
237235 if values.dtype != np.object_:
0 commit comments