Beispiel #1
0
def test_no_categorize():
    df = pd.DataFrame({"a": [i for i in range(99)]})
    Items.categorize(df)
    assert df.select_dtypes(["category"]).empty
Beispiel #2
0
def test_categorize(data, expected_cats):
    df = pd.DataFrame(data)
    Items.categorize(df)
    np.testing.assert_array_equal(
        df.select_dtypes(["category"]).columns.values, expected_cats)