test_where.py 341 B

12345678910111213
  1. import numpy as np
  2. from pandas import Index
  3. import pandas._testing as tm
  4. class TestWhere:
  5. def test_where_intlike_str_doesnt_cast_ints(self):
  6. idx = Index(range(3))
  7. mask = np.array([True, False, True])
  8. res = idx.where(mask, "2")
  9. expected = Index([0, "2", 2])
  10. tm.assert_index_equal(res, expected)