use `weights=tri_nn[:, idx]` makes it more readable for those not that familiar with bincount ;)