def test_setops(self):
        index = self.frame.index
        obj_index = index.asobject

        result = index[:5].union(obj_index[5:])
        expected = index
        tm.assertIsInstance(result, DatetimeIndex)
        self.assertTrue(result.equals(expected))

        result = index[:10].intersection(obj_index[5:])
        expected = index[5:10]
        tm.assertIsInstance(result, DatetimeIndex)
        self.assertTrue(result.equals(expected))

        result = index[:10] - obj_index[5:]
        expected = index[:5]
        tm.assertIsInstance(result, DatetimeIndex)
        self.assertTrue(result.equals(expected))
dataset/ETHPy150Open pydata/pandas/pandas/tseries/tests/test_timeseries_legacy.py/LegacySupport.test_setops/original