Fast pairwise combinations in NumPy
Oct 2, 2021
Instead of using Python’sitertools.combinatios(arr, r=2)
you can achieve the same goal by generating the upper triangle of an (n, n) array and excluding the diagonal (k=1). Benchmark below.
Instead of using Python’sitertools.combinatios(arr, r=2)
you can achieve the same goal by generating the upper triangle of an (n, n) array and excluding the diagonal (k=1). Benchmark below.