Skip to content

Commit d545493

Browse files
committed
add asv tests
1 parent 9d1889a commit d545493

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
@@ -133,12 +133,24 @@ class ValueCounts:
133133
param_names = ["N", "dtype"]
134134

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

138138
def time_value_counts(self, N, dtype):
139139
self.s.value_counts()
140140

141141

142+
class ValueCountsObjectDropNAFalse:
143+
144+
params = [10 ** 3, 10 ** 4, 10 ** 5]
145+
param_names = ["N"]
146+
147+
def setup(self, N):
148+
self.s = Series(np.random.randint(0, N, size=10 * N)).astype("object")
149+
150+
def time_value_counts(self, N):
151+
self.s.value_counts(dropna=False)
152+
153+
142154
class Mode:
143155

144156
params = [[10 ** 3, 10 ** 4, 10 ** 5], ["int", "uint", "float", "object"]]
@@ -151,6 +163,18 @@ def time_mode(self, N, dtype):
151163
self.s.mode()
152164

153165

166+
class ModeObjectDropNAFalse:
167+
168+
params = [10 ** 3, 10 ** 4, 10 ** 5]
169+
param_names = ["N"]
170+
171+
def setup(self, N):
172+
self.s = Series(np.random.randint(0, N, size=10 * N)).astype("object")
173+
174+
def time_mode(self, N):
175+
self.s.mode(dropna=False)
176+
177+
154178
class Dir:
155179
def setup(self):
156180
self.s = Series(index=tm.makeStringIndex(10000))

0 commit comments

Comments
 (0)