Skip to content

Commit 4d14cfa

Browse files
committed
Add comment to explain choice of parameters [ci skip]
1 parent dadeeda commit 4d14cfa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

asv_bench/benchmarks/strings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ def setup(self, others, sep, na_rep, na_frac):
100100
if others is not None else None)
101101

102102
def time_cat(self, others, sep, na_rep, na_frac):
103+
# before the concatenation (one caller + others columns), the total
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%
103107
self.s.str.cat(self.others, sep=sep, na_rep=na_rep)
104108

105109

0 commit comments

Comments
 (0)