Skip to content

Commit

Permalink
TEST-#2690: add category dtype; use df.types
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Feb 9, 2021
1 parent ec0b4c1 commit cd493f5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions asv_bench/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

def execute(df):
"Make sure the calculations are done."
return df.shape
return df.shape, df.dtypes


class BaseTimeGroupBy:
Expand Down Expand Up @@ -490,13 +490,14 @@ def time_value_counts(self, shape, bins):


class TimeAstype:
param_names = ["shape"]
param_names = ["shape", "dtype"]
params = [
UNARY_OP_DATA_SIZE[ASV_DATASET_SIZE],
["float64", "category"],
]

def setup(self, shape):
def setup(self, shape, dtype):
self.df = generate_dataframe(ASV_USE_IMPL, "int", *shape, RAND_LOW, RAND_HIGH)

def time_astype(self, shape):
execute(self.df.astype("float64"))
def time_astype(self, shape, dtype):
execute(self.df.astype(dtype))

0 comments on commit cd493f5

Please sign in to comment.