Skip to content

Commit 1ea7d1d

Browse files
author
Mike Phung
committed
TST GH#40498 Clean up fillna benchmark tests.
1 parent ddc8bd8 commit 1ea7d1d

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

asv_bench/benchmarks/frame_methods.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,11 @@ class Fillna:
376376
[True, False],
377377
[None, "pad", "bfill"],
378378
[
379-
"float64",
380-
"float32",
381379
"object",
382-
"Int64",
383-
"Float64",
380+
"int32",
381+
"int64",
382+
"float32",
383+
"float64",
384384
"datetime64[ns]",
385385
"datetime64[ns, tz]",
386386
"timedelta64[ns]",
@@ -405,8 +405,7 @@ def setup(self, inplace, method, dtype):
405405
)
406406
else:
407407
data = np.random.randn(N, M)
408-
if dtype == "Int64":
409-
data = data.round()
408+
data = data.astype(dtype)
410409
self.df = DataFrame({f"col_{i}": data[i] for i in range(M)})
411410
self.df[::2] = None
412411
self.value = dict(zip(self.df.columns, data[M])) if not method else None

asv_bench/benchmarks/series_methods.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ class Fillna:
4949
[True, False],
5050
[None, "pad", "bfill"],
5151
[
52-
"float64",
53-
"float32",
5452
"object",
55-
"Int64",
56-
"Float64",
53+
"int32",
54+
"int64",
55+
"float32",
56+
"float64",
5757
"datetime64[ns]",
5858
"datetime64[ns, tz]",
5959
"timedelta64[ns]",
@@ -76,8 +76,7 @@ def setup(self, inplace, method, dtype):
7676
self.value = dict(zip(self.ser.index, data[dtype])) if not method else None
7777
else:
7878
data = np.random.randn(N)
79-
if dtype == "Int64":
80-
data = data.round()
79+
data = data.astype(dtype)
8180
self.ser = Series(data, dtype=dtype)
8281
self.ser[::2] = None
8382
self.value = dict(zip(self.ser.index, data)) if not method else None

0 commit comments

Comments
 (0)