Skip to content

Commit 2b4bcf2

Browse files
authoredJan 1, 2021
REF/POC: Share groupby/series algos (rank) (#38744)
1 parent 92ac5e0 commit 2b4bcf2

File tree

8 files changed

+306
-332
lines changed

8 files changed

+306
-332
lines changed
 

‎asv_bench/benchmarks/frame_methods.py

+13
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,19 @@ def time_frame_quantile(self, axis):
597597
self.df.quantile([0.1, 0.5], axis=axis)
598598

599599

600+
class Rank:
601+
param_names = ["dtype"]
602+
params = [
603+
["int", "uint", "float", "object"],
604+
]
605+
606+
def setup(self, dtype):
607+
self.df = DataFrame(np.random.randn(10000, 10), columns=range(10), dtype=dtype)
608+
609+
def time_rank(self, dtype):
610+
self.df.rank()
611+
612+
600613
class GetDtypeCounts:
601614
# 2807
602615
def setup(self):

‎asv_bench/benchmarks/groupby.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"skew",
3030
"cumprod",
3131
"cummax",
32-
"rank",
3332
"pct_change",
3433
"min",
3534
"var",

‎asv_bench/benchmarks/series_methods.py

+14
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,18 @@ def time_func(self, func, N, dtype):
349349
self.func()
350350

351351

352+
class Rank:
353+
354+
param_names = ["dtype"]
355+
params = [
356+
["int", "uint", "float", "object"],
357+
]
358+
359+
def setup(self, dtype):
360+
self.s = Series(np.random.randint(0, 1000, size=100000), dtype=dtype)
361+
362+
def time_rank(self, dtype):
363+
self.s.rank()
364+
365+
352366
from .pandas_vb_common import setup # noqa: F401 isort:skip

0 commit comments

Comments
 (0)
Please sign in to comment.