

def test_behavior_X_array(self):
    X = numpy.array([0, 1, 2, 3])
    counts = qtu.bincount(X)
    assert (counts == [1, 1, 1, 1])
    X = numpy.array([1, 2, 2, 4, 6])
    counts = qtu.bincount(X)
    assert (counts == [1, 2, 0, 1, 0, 1])
    bins = list(range(7))
    counts = qtu.bincount(X, bins)
    assert (counts == [0, 1, 2, 0, 1, 0, 1])
    bins = [1, 2, 4, 6]
    counts = qtu.bincount(X, bins)
    assert (counts == [1, 2, 1, 1])

dataset/ETHPy150Open probcomp/crosscat/src/tests/unit_tests/test_quality_test_utils.py TestBincount.test_behavior_X_array/original