test_combine.py 627 B

1234567891011121314151617
  1. from pandas import Series
  2. import pandas._testing as tm
  3. class TestCombine:
  4. def test_combine_scalar(self):
  5. # GH#21248
  6. # Note - combine() with another Series is tested elsewhere because
  7. # it is used when testing operators
  8. ser = Series([i * 10 for i in range(5)])
  9. result = ser.combine(3, lambda x, y: x + y)
  10. expected = Series([i * 10 + 3 for i in range(5)])
  11. tm.assert_series_equal(result, expected)
  12. result = ser.combine(22, lambda x, y: min(x, y))
  13. expected = Series([min(i * 10, 22) for i in range(5)])
  14. tm.assert_series_equal(result, expected)