Пример #1
0
def test_percentile():
    assert ds.percentile(0, [1, 3, 5, 9]) == 1
    assert ds.percentile(25, [1, 3, 5, 9]) == 1
    assert ds.percentile(26, [1, 3, 5, 9]) == 3
    assert ds.percentile(55, [1, 3, 5, 9]) == 5
    assert ds.percentile(75, [1, 3, 5, 9]) == 5
    assert ds.percentile(76, [1, 3, 5, 9]) == 9

    f1 = ds.percentile(66)
    assert f1([1, 3, 5, 9]) == 5

    f2 = ds.percentile([65, 85])
    assert np.all(f2([9, 5, 3, 1]) == np.array([5, 9]))
Пример #2
0
def test_percentile():
    assert ds.percentile(0, [1, 3, 5, 9]) == 1
    assert ds.percentile(25, [1, 3, 5, 9]) == 1
    assert ds.percentile(26, [1, 3, 5, 9]) == 3
    assert ds.percentile(55, [1, 3, 5, 9]) == 5
    assert ds.percentile(75, [1, 3, 5, 9]) == 5
    assert ds.percentile(76, [1, 3, 5, 9]) == 9

    f1 = ds.percentile(66)
    assert f1([1, 3, 5, 9]) == 5

    f2 = ds.percentile([65, 85])
    assert np.all(f2([9, 5, 3, 1]) == np.array([5, 9]))
Пример #3
0
def test_percentile():
    assert ds.percentile(0, [1, 3, 5, 9]) == 1
    assert ds.percentile(33, [1, 3, 5, 9]) == 3
    assert ds.percentile(34, [1, 3, 5, 9]) == 5
    assert ds.percentile(66, [1, 3, 5, 9]) == 5
    assert ds.percentile(67, [1, 3, 5, 9]) == 9

    f1 = ds.percentile(67)
    assert f1([1, 3, 5, 9]) == 9

    f2 = ds.percentile(66)
    assert f2([1, 3, 5, 9]) == 5
Пример #4
0
def test_percentile():
    assert ds.percentile(0, [1, 3, 5, 9]) == 1
    assert ds.percentile(33, [1, 3, 5, 9]) == 3
    assert ds.percentile(34, [1, 3, 5, 9]) == 5
    assert ds.percentile(66, [1, 3, 5, 9]) == 5
    assert ds.percentile(67, [1, 3, 5, 9]) == 9

    f1 = ds.percentile(67)
    assert f1([1, 3, 5, 9]) == 9

    f2 = ds.percentile(66)
    assert f2([1, 3, 5, 9]) == 5