Skip to content

Commit d39dcf6

Browse files
committed
VB: add a vbench for groupby count
1 parent 6c8b56a commit d39dcf6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

vb_suite/groupby.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,19 @@ def f():
119119
setup, start_date=datetime(2011, 10, 1))
120120

121121
#----------------------------------------------------------------------
122+
# count() speed
123+
124+
setup = common_setup + """
125+
df = DataFrame({'key1': np.random.randint(0, 500, size=100000),
126+
'key2': np.random.randint(0, 100, size=100000),
127+
'value1' : np.random.randn(100000),
128+
'value2' : np.random.randn(100000),
129+
'value3' : np.random.randn(100000)})
130+
"""
131+
132+
groupby_multi_count = Benchmark("df.groupby(['key1', 'key2']).count()",
133+
setup, start_date=datetime(2014, 5, 1))
134+
#----------------------------------------------------------------------
122135
# Series.value_counts
123136

124137
setup = common_setup + """

0 commit comments

Comments
 (0)