Skip to content

Commit 862abe2

Browse files
committed
Review (WillAyd) [ci skip]
1 parent 67503c6 commit 862abe2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

asv_bench/benchmarks/strings.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,12 @@ def setup(self, other_cols, sep, na_rep, na_frac):
9595
mask_gen = lambda: np.random.choice([True, False], N,
9696
p=[1 - na_frac, na_frac])
9797
self.s = Series(tm.makeStringIndex(N)).where(mask_gen())
98-
self.others = (DataFrame({i: tm.makeStringIndex(N).where(mask_gen())
99-
for i in range(other_cols)})
100-
if other_cols > 0 else None)
98+
if other_cols == 0:
99+
# str.cat self-concatenates only for others=None
100+
self.others = None
101+
else:
102+
self.others = DataFrame({i: tm.makeStringIndex(N).where(mask_gen())
103+
for i in range(other_cols)})
101104

102105
def time_cat(self, other_cols, sep, na_rep, na_frac):
103106
# before the concatenation (one caller + other_cols columns), the total

0 commit comments

Comments
 (0)