def test_sample_without_replacement_shape():
    assert_array_equal(sample_without_replacement(2, 0).shape, (0, ))

    n, k, m = 5, 3, 4
    assert_array_equal(sample_without_replacement(n, k).shape, (k, ))
    assert_array_equal(
        sample_without_replacement(n, k, num_trials=m).shape, (m, k))
def test_sample_without_replacement_shape():
    assert_array_equal(sample_without_replacement(2, 0).shape, (0,))

    n, k, m = 5, 3, 4
    assert_array_equal(
        sample_without_replacement(n, k).shape,
        (k,)
    )
    assert_array_equal(
        sample_without_replacement(n, k, num_trials=m).shape,
        (m, k)
    )
Example #3
0
def test_sample_without_replacement_uniqueness():
    n = 10
    a = sample_without_replacement(n, n)
    b = np.unique(a)
    assert_(len(b) == n)
def test_sample_without_replacement_uniqueness():
    n = 10
    a = sample_without_replacement(n, n)
    b = np.unique(a)
    eq_(len(b), n)