#NEWLINE# def test_ops_compat( self ) : #NEWLINE# #INDENT# offsets = [ pd . offsets . Hour ( 2 ) , timedelta ( hours = 2 ) , np . timedelta64 ( 2 , 'h' ) , Timedelta ( hours = 2 ) ] #NEWLINE# rng = timedelta_range ( '1 days' , '10 days' , name = 'foo' ) #NEWLINE# for offset in offsets : #NEWLINE# #INDENT# self . assertRaises ( TypeError , ( lambda : ( rng * offset ) ) ) #NEWLINE# #UNINDENT# expected = Int64Index ( ( ( np . arange ( 10 ) + 1 ) * 12 ) , name = 'foo' ) #NEWLINE# for offset in offsets : #NEWLINE# #INDENT# result = ( rng / offset ) #NEWLINE# tm . assert_index_equal ( result , expected , exact = False ) #NEWLINE# #UNINDENT# rng = TimedeltaIndex ( [ '1 days' , pd . NaT , '2 days' ] , name = 'foo' ) #NEWLINE# expected = Float64Index ( [ 12 , np . nan , 24 ] , name = 'foo' ) #NEWLINE# for offset in offsets : #NEWLINE# #INDENT# result = ( rng / offset ) #NEWLINE# tm . assert_index_equal ( result , expected ) #NEWLINE# #UNINDENT# self . assertRaises ( TypeError , ( lambda : ( rng / pd . NaT ) ) )