#NEWLINE# def test_ops_nat( self ) : #NEWLINE# #INDENT# timedelta_series = Series ( [ NaT , Timedelta ( '1s' ) ] ) #NEWLINE# datetime_series = Series ( [ NaT , Timestamp ( '19900315' ) ] ) #NEWLINE# nat_series_dtype_timedelta = Series ( [ NaT , NaT ] , dtype = 'timedelta64[ns]' ) #NEWLINE# nat_series_dtype_timestamp = Series ( [ NaT , NaT ] , dtype = 'datetime64[ns]' ) #NEWLINE# single_nat_dtype_datetime = Series ( [ NaT ] , dtype = 'datetime64[ns]' ) #NEWLINE# single_nat_dtype_timedelta = Series ( [ NaT ] , dtype = 'timedelta64[ns]' ) #NEWLINE# assert_series_equal ( ( timedelta_series - NaT ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( ( - NaT ) + timedelta_series ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( timedelta_series - single_nat_dtype_timedelta ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( ( - single_nat_dtype_timedelta ) + timedelta_series ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( datetime_series - NaT ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( ( - NaT ) + datetime_series ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( datetime_series - single_nat_dtype_datetime ) , nat_series_dtype_timedelta ) #NEWLINE# with tm . assertRaises ( TypeError ) : #NEWLINE# #INDENT# ( ( - single_nat_dtype_datetime ) + datetime_series ) #NEWLINE# #UNINDENT# assert_series_equal ( ( datetime_series - single_nat_dtype_timedelta ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( ( - single_nat_dtype_timedelta ) + datetime_series ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timestamp - NaT ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( ( - NaT ) + nat_series_dtype_timestamp ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timestamp - single_nat_dtype_datetime ) , nat_series_dtype_timedelta ) #NEWLINE# with tm . assertRaises ( TypeError ) : #NEWLINE# #INDENT# ( ( - single_nat_dtype_datetime ) + nat_series_dtype_timestamp ) #NEWLINE# #UNINDENT# assert_series_equal ( ( nat_series_dtype_timestamp - single_nat_dtype_timedelta ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( ( - single_nat_dtype_timedelta ) + nat_series_dtype_timestamp ) , nat_series_dtype_timestamp ) #NEWLINE# with tm . assertRaises ( TypeError ) : #NEWLINE# #INDENT# ( timedelta_series - single_nat_dtype_datetime ) #NEWLINE# #UNINDENT# assert_series_equal ( ( nat_series_dtype_timestamp + NaT ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( NaT + nat_series_dtype_timestamp ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timestamp + single_nat_dtype_timedelta ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( single_nat_dtype_timedelta + nat_series_dtype_timestamp ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timedelta + NaT ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( NaT + nat_series_dtype_timedelta ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timedelta + single_nat_dtype_timedelta ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( single_nat_dtype_timedelta + nat_series_dtype_timedelta ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( timedelta_series + NaT ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( NaT + timedelta_series ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( timedelta_series + single_nat_dtype_timedelta ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( single_nat_dtype_timedelta + timedelta_series ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timestamp + NaT ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( NaT + nat_series_dtype_timestamp ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timestamp + single_nat_dtype_timedelta ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( single_nat_dtype_timedelta + nat_series_dtype_timestamp ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timedelta + NaT ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( NaT + nat_series_dtype_timedelta ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timedelta + single_nat_dtype_timedelta ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( single_nat_dtype_timedelta + nat_series_dtype_timedelta ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timedelta + single_nat_dtype_datetime ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( single_nat_dtype_datetime + nat_series_dtype_timedelta ) , nat_series_dtype_timestamp ) #NEWLINE# assert_series_equal ( ( nat_series_dtype_timedelta * 1.0 ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( 1.0 * nat_series_dtype_timedelta ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( timedelta_series * 1 ) , timedelta_series ) #NEWLINE# assert_series_equal ( ( 1 * timedelta_series ) , timedelta_series ) #NEWLINE# assert_series_equal ( ( timedelta_series * 1.5 ) , Series ( [ NaT , Timedelta ( '1.5s' ) ] ) ) #NEWLINE# assert_series_equal ( ( 1.5 * timedelta_series ) , Series ( [ NaT , Timedelta ( '1.5s' ) ] ) ) #NEWLINE# assert_series_equal ( ( timedelta_series * nan ) , nat_series_dtype_timedelta ) #NEWLINE# assert_series_equal ( ( nan * timedelta_series ) , nat_series_dtype_timedelta ) #NEWLINE# with tm . assertRaises ( TypeError ) : #NEWLINE# #INDENT# ( datetime_series * 1 ) #NEWLINE# #UNINDENT# with tm . assertRaises ( TypeError ) : #NEWLINE# #INDENT# ( nat_series_dtype_timestamp * 1 ) #NEWLINE# #UNINDENT# with tm . assertRaises ( TypeError ) : #NEWLINE# #INDENT# ( datetime_series * 1.0 ) #NEWLINE# #UNINDENT# with tm . assertRaises ( TypeError ) : #NEWLINE# #INDENT# ( nat_series_dtype_timestamp * 1.0 ) #NEWLINE# #UNINDENT# assert_series_equal ( ( timedelta_series / 2 ) , Series ( [ NaT , Timedelta ( '0.5s' ) ] ) ) #NEWLINE# assert_series_equal ( ( timedelta_series / 2.0 ) , Series ( [ NaT , Timedelta ( '0.5s' ) ] ) ) #NEWLINE# assert_series_equal ( ( timedelta_series / nan ) , nat_series_dtype_timedelta ) #NEWLINE# with tm . assertRaises ( TypeError ) : #NEWLINE# #INDENT# ( nat_series_dtype_timestamp / 1.0 ) #NEWLINE# #UNINDENT# with tm . assertRaises ( TypeError ) : #NEWLINE# #INDENT# ( nat_series_dtype_timestamp / 1 )