Skip to content

Commit 90dbd92

Browse files
committed
add asv tests
1 parent 14c9527 commit 90dbd92

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

asv_bench/benchmarks/series_methods.py

+25-1
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,24 @@ class ValueCounts:
146146
param_names = ["N", "dtype"]
147147

148148
def setup(self, N, dtype):
149-
self.s = Series(np.random.randint(0, N, size=10 * N)).astype(dtype)
149+
self.s = Series(np.random.randint(0, N, size=10 * N)).astype("object")
150150

151151
def time_value_counts(self, N, dtype):
152152
self.s.value_counts()
153153

154154

155+
class ValueCountsObjectDropNAFalse:
156+
157+
params = [10 ** 3, 10 ** 4, 10 ** 5]
158+
param_names = ["N"]
159+
160+
def setup(self, N):
161+
self.s = Series(np.random.randint(0, N, size=10 * N)).astype("object")
162+
163+
def time_value_counts(self, N):
164+
self.s.value_counts(dropna=False)
165+
166+
155167
class Mode:
156168

157169
params = [[10 ** 3, 10 ** 4, 10 ** 5], ["int", "uint", "float", "object"]]
@@ -164,6 +176,18 @@ def time_mode(self, N, dtype):
164176
self.s.mode()
165177

166178

179+
class ModeObjectDropNAFalse:
180+
181+
params = [10 ** 3, 10 ** 4, 10 ** 5]
182+
param_names = ["N"]
183+
184+
def setup(self, N):
185+
self.s = Series(np.random.randint(0, N, size=10 * N)).astype("object")
186+
187+
def time_mode(self, N):
188+
self.s.mode(dropna=False)
189+
190+
167191
class Dir:
168192
def setup(self):
169193
self.s = Series(index=tm.makeStringIndex(10000))

0 commit comments

Comments
 (0)