def test_comb_indices(): n, k = 3, 2 data = np.arange(6).reshape(2, 3) assert np.array_equal(data[:, utils.comb_indices(n, k)], np.asarray([[[0, 1], [0, 2], [1, 2]], [[3, 4], [3, 5], [4, 5]]]))
def test_comb_indices(): n, k = 3, 2 data = np.arange(6).reshape(2, 3) # fmt: off answer = np.array([ [[0, 1], [0, 2], [1, 2]], [[3, 4], [3, 5], [4, 5]], ]) # fmt: on assert np.array_equal(data[:, utils.comb_indices(n, k)], answer)
def test_comb_indices(): n, k = 3, 2 data = np.arange(6).reshape(2, 3) assert np.array_equal( data[:, utils.comb_indices(n, k)], np.asarray([[[0, 1], [0, 2], [1, 2]], [[3, 4], [3, 5], [4, 5]]]))