@@ -87,24 +87,24 @@ def time_repeat(self, repeats):
87
87
class Cat (object ):
88
88
89
89
goal_time = 0.2
90
- params = ([None , 5 ], [None , ',' ], [None , '-' ], [0.0 , 1e-4 , 0.1 ])
91
- param_names = ['others ' , 'sep' , 'na_rep' , 'na_frac' ]
90
+ params = ([0 , 3 ], [None , ',' ], [None , '-' ], [0.0 , 0.01 , 0.15 ])
91
+ param_names = ['other_cols ' , 'sep' , 'na_rep' , 'na_frac' ]
92
92
93
- def setup (self , others , sep , na_rep , na_frac ):
94
- N = int ( 5e5 )
93
+ def setup (self , other_cols , sep , na_rep , na_frac ):
94
+ N = 10 ** 5
95
95
mask_gen = lambda : np .random .choice ([True , False ], N ,
96
96
p = [1 - na_frac , na_frac ])
97
97
self .s = Series (tm .makeStringIndex (N )).where (mask_gen ())
98
98
self .others = (DataFrame ({i : tm .makeStringIndex (N ).where (mask_gen ())
99
- for i in range (others )})
100
- if others is not None else None )
99
+ for i in range (other_cols )})
100
+ if other_cols > 0 else None )
101
101
102
- def time_cat (self , others , sep , na_rep , na_frac ):
103
- # before the concatenation (one caller + others columns), the total
102
+ def time_cat (self , other_cols , sep , na_rep , na_frac ):
103
+ # before the concatenation (one caller + other_cols columns), the total
104
104
# expected fraction of rows containing any NaN is:
105
- # reduce(lambda t, _: t + (1 - t) * na_frac, range(others + 1), 0)
106
- # for others=5 and na_frac=0.1 , this works out to ~47 %
107
- self .s .str .cat (self .others , sep = sep , na_rep = na_rep )
105
+ # reduce(lambda t, _: t + (1 - t) * na_frac, range(other_cols + 1), 0)
106
+ # for other_cols=3 and na_frac=0.15 , this works out to ~48 %
107
+ self .s .str .cat (others = self .others , sep = sep , na_rep = na_rep )
108
108
109
109
110
110
class Contains (object ):
0 commit comments