def unique_combs(A, N):
    m, n = A.shape
dec_idx = np.random.choice(2 ** m, N, replace=False)
idx = (dec_idx[:, (None)] & 1 << np.arange(m) != 0).astype(int)
return A[np.arange(m), idx]
Using Numpy to generate random combinations of two arrays without repetition