Exemple #1
0
 def test_assignment_can_be_instantiated_from_series(self):
     series = pandas.Series([1, 2, 1, 2], index=[1, 2, 3, 4])
     assignment = Assignment.from_dict(series)
     assert assignment == {1: 1, 2: 2, 3: 1, 4: 2}
def assignment():
    return Assignment.from_dict({1: 1, 2: 2, 3: 2})
Exemple #3
0
 def test_assignment_raises_if_a_key_has_two_assignments(self):
     with pytest.raises(ValueError):
         Assignment({"one": {1, 2, 3}, "two": {1, 4, 5}})