Easy one this time. Hard to time, as cardinalities are cached.
# first run (weighted)
# CPU times: user 49.5 ms, sys: 121 ms, total: 170 ms
# Wall time: 179 ms
# timeit
# 25.7 ms ± 190 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) - new
# 549 ms ± 2.07 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) - old
Faster esp. if other function before called cardinalities.
Easy one this time. Hard to time, as
cardinalities
are cached.Faster esp. if other function before called cardinalities.