def test_dti_cmp_nat(self):
    left = pd.DatetimeIndex([pd.Timestamp('2011-01-01'), pd.NaT, pd.Timestamp('2011-01-03')])
    right = pd.DatetimeIndex([pd.NaT, pd.NaT, pd.Timestamp('2011-01-03')])
    for (lhs, rhs) in [(left, right), (left.astype(object), right.astype(object))]:
        result = (rhs == lhs)
        expected = np.array([False, False, True])
        tm.assert_numpy_array_equal(result, expected)
        result = (lhs != rhs)
        expected = np.array([True, True, False])
        tm.assert_numpy_array_equal(result, expected)
        expected = np.array([False, False, False])
        tm.assert_numpy_array_equal((lhs == pd.NaT), expected)
        tm.assert_numpy_array_equal((pd.NaT == rhs), expected)
        expected = np.array([True, True, True])
        tm.assert_numpy_array_equal((lhs != pd.NaT), expected)
        tm.assert_numpy_array_equal((pd.NaT != lhs), expected)
        expected = np.array([False, False, False])
        tm.assert_numpy_array_equal((lhs < pd.NaT), expected)
        tm.assert_numpy_array_equal((pd.NaT > lhs), expected)
def test_dti_cmp_nat(self):
    left = pd.DatetimeIndex([pd.Timestamp('2011-01-01'), pd.NaT, pd.Timestamp('2011-01-03')])
    right = pd.DatetimeIndex([pd.NaT, pd.NaT, pd.Timestamp('2011-01-03')])
    for (lhs, rhs) in [(left, right), (left.astype(object), right.astype(object))]:
        result = (rhs == lhs)
        expected = np.array([False, False, True])
        tm.assert_numpy_array_equal(result, expected)
        result = (lhs != rhs)
        expected = np.array([True, True, False])
        tm.assert_numpy_array_equal(result, expected)
        expected = np.array([False, False, False])
        tm.assert_numpy_array_equal((lhs == pd.NaT), expected)
        tm.assert_numpy_array_equal((pd.NaT == rhs), expected)
        expected = np.array([True, True, True])
        tm.assert_numpy_array_equal((lhs != pd.NaT), expected)
        tm.assert_numpy_array_equal((pd.NaT != lhs), expected)
        expected = np.array([False, False, False])
        tm.assert_numpy_array_equal((lhs < pd.NaT), expected)
        tm.assert_numpy_array_equal((pd.NaT > lhs), expected)