예제 #1
0
def test_temp_column_name_one_already():
    df1 = pd.DataFrame([{"_temp_1": "hi", "b": 2}, {"_temp_1": "bye", "b": 2}])
    df2 = pd.DataFrame(
        [{"_temp_1": "hi", "b": 2}, {"_temp_1": "bye", "b": 2}, {"a": "back fo mo", "b": 3}]
    )
    actual = datacompy.temp_column_name(df1, df2)
    assert actual == "_temp_0"
예제 #2
0
def test_temp_column_name_one_already():
    df1 = pd.DataFrame([{'_temp_1': 'hi', 'b': 2}, {'_temp_1': 'bye', 'b': 2}])
    df2 = pd.DataFrame([{
        '_temp_1': 'hi',
        'b': 2
    }, {
        '_temp_1': 'bye',
        'b': 2
    }, {
        'a': 'back fo mo',
        'b': 3
    }])
    actual = datacompy.temp_column_name(df1, df2)
    assert actual == '_temp_0'