Пример #1
0
def test_unique_index():
    df = pd.DataFrame([1, 2, 3], index=['a', 'b', 'c'])
    tm.assert_frame_equal(df, ck.unique_index(df))
    result = dc.unique_index()(_add_n)(df)
    tm.assert_frame_equal(result, df + 1)

    with pytest.raises(AssertionError):
        ck.unique_index(df.reindex(['a', 'a', 'b']))
    with pytest.raises(AssertionError):
        dc.unique_index()(_add_n)(df.reindex(['a', 'a', 'b']))
Пример #2
0
def test_unique_index():
    df = pd.DataFrame([1, 2, 3], index=['a', 'b', 'c'])
    tm.assert_frame_equal(df, ck.unique_index(df))
    result = dc.unique_index()(_add_n)(df)
    tm.assert_frame_equal(result, df + 1)

    with pytest.raises(AssertionError):
        ck.unique_index(df.reindex(['a', 'a', 'b']))
    with pytest.raises(AssertionError):
        dc.unique_index()(_add_n)(df.reindex(['a', 'a', 'b']))