示例#1
0
 def time_key2_opsum_const12_baseline(self) -> None:
     self.df_baseline.groupby(dim_col(2))[const_col([1, 2])].sum()
示例#2
0
 def time_add_const12_baseline(self):
     self.df_baseline[const_col([1, 2])] + self.df_baseline[const_col([1, 2])]
示例#3
0
 def test_const_value_counts(self, df: pd.DataFrame,
                             dims: List[int]) -> None:
     assert (df[const_col(dims)].value_counts() == SIZE**(N_DIMS -
                                                          len(dims))).all()
示例#4
0
 def time_sum_const012_baseline(self):
     self.df_baseline[const_col([0, 1, 2])].sum()
示例#5
0
 def time_shift_int_const12_rle(self):
     self.df_rle[const_col([1, 2])].shift(periods=1, fill_value=1)
示例#6
0
 def time_take_unstable_const12_base(self):
     self.df_baseline[const_col([1, 2])].take(self.shuffle_dim2_unstable)
示例#7
0
 def time_groupby2_sum_const12_baseline(self):
     self.df_baseline.groupby(dim_col(2))[const_col([1, 2])].sum()
示例#8
0
 def time_const12_base(self) -> None:
     self.df_baseline[const_col([1, 2])].unique()
示例#9
0
 def time_const12_rle(self) -> None:
     self.df_rle[const_col([1, 2])].unique()
示例#10
0
 def time_int_const12_base(self) -> None:
     self.df_baseline[const_col([1, 2])].shift(periods=1, fill_value=1)
示例#11
0
 def time_float_const12_base(self) -> None:
     self.df_baseline[const_col([1, 2])].shift(periods=1)
示例#12
0
 def time_sum_const12_rle(self) -> None:
     self.df_rle[const_col([1, 2])].sum()
示例#13
0
 def time_sum_const12_baseline(self) -> None:
     self.df_baseline[const_col([1, 2])].sum()
示例#14
0
def test_const_col(dims: List[int], expected: str) -> None:
    actual = const_col(dims)
    assert actual == expected
示例#15
0
 def time_eq_const12_baseline(self):
     self.df_baseline[const_col([1, 2])] == self.df_baseline[const_col([1, 2])]
示例#16
0
 def time_const12_base(self) -> None:
     self.df_baseline[const_col([1, 2])].factorize()
示例#17
0
 def time_eq_const12_rle(self):
     self.df_rle[const_col([1, 2])] == self.df_rle[const_col([1, 2])]
示例#18
0
 def time_const12_rle(self) -> None:
     with self.ignore_performance_warnings():
         self.df_rle[const_col([1, 2])].factorize()
示例#19
0
 def time_take_stable_const12_rle(self):
     self.df_rle[const_col([1, 2])].take(self.shuffle_dim2_stable)
示例#20
0
 def time_decompress_array_astype(self) -> None:
     with self.ignore_performance_warnings():
         self.df_rle[const_col([1, 2])].array.astype(np.int64)
示例#21
0
 def time_groupby2_sum_const12_rle(self):
     with self.ignore_performance_warnings():
         self.df_rle_wo_dims.groupby(dim_col(2))[const_col([1, 2])].sum()
示例#22
0
 def time_decompress_to_numpy(self) -> None:
     with self.ignore_performance_warnings():
         self.df_rle[const_col([1, 2])].to_numpy()
示例#23
0
 def time_sum_const012_rle(self):
     self.df_rle[const_col([0, 1, 2])].sum()
示例#24
0
 def time_unstable_const12_rle(self) -> None:
     self.df_rle[const_col([1, 2])].take(self.shuffle_dim2_unstable)
示例#25
0
 def time_shift_float_const12_rle(self):
     self.df_rle[const_col([1, 2])].shift(periods=1)
示例#26
0
 def time_stable_const12_base(self) -> None:
     self.df_baseline[const_col([1, 2])].take(self.shuffle_dim2_stable)
示例#27
0
 def time_add_const12_rle(self):
     self.df_rle[const_col([1, 2])] + self.df_rle[const_col([1, 2])]
示例#28
0
 def test_const_nunique(self, df: pd.DataFrame, dims: List[int]) -> None:
     assert df[const_col(dims)].nunique() == SIZE**len(dims)