Skip to content

Commit

Permalink
TEST-modin-project#2690: add case with one column
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev committed Feb 9, 2021
1 parent cd493f5 commit ec686bc
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions asv_bench/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,21 @@ def time_value_counts(self, shape, bins):


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

def setup(self, shape, dtype):
def setup(self, shape, dtype, astype_ncolumns):
self.df = generate_dataframe(ASV_USE_IMPL, "int", *shape, RAND_LOW, RAND_HIGH)
if astype_ncolumns == "all":
self.astype_arg = dtype
elif astype_ncolumns == "one":
self.astype_arg = {"col1": dtype}
else:
raise ValueError("astype_ncolumns: {astype_ncolumns} isn't supported")

def time_astype(self, shape, dtype):
execute(self.df.astype(dtype))
def time_astype(self, shape, dtype, astype_ncolumns):
execute(self.df.astype(self.astype_arg))

0 comments on commit ec686bc

Please sign in to comment.