예제 #1
0
def test_negative_ordinal():
    # check that a low card int with negative values is plotted correctly
    data = pd.DataFrame([
        np.random.randint(0, 10, size=1000) - 5,
        np.random.randint(0, 2, size=1000)
    ]).T
    # ensure first column is low_card_int
    assert (detect_types(data).T.idxmax() == ['low_card_int',
                                              'categorical']).all()
    assert guess_ordinal(data[0])
    # smoke test
    plot(data, target_col=1)
예제 #2
0
def test_large_ordinal():
    # check that large integers don't bring us down (bincount memory error)
    # here some random phone numbers
    assert not guess_ordinal(pd.Series([6786930208, 2142878625, 9106275431]))