#NEWLINE# def test_numeric_compat( self ) : #NEWLINE# #INDENT# idx = self . _holder ( np . arange ( 5 , dtype = 'int64' ) ) #NEWLINE# didx = self . _holder ( ( np . arange ( 5 , dtype = 'int64' ) ** 2 ) ) #NEWLINE# result = ( idx * 1 ) #NEWLINE# tm . assert_index_equal ( result , idx ) #NEWLINE# result = ( 1 * idx ) #NEWLINE# tm . assert_index_equal ( result , idx ) #NEWLINE# result = ( idx / 1 ) #NEWLINE# tm . assert_index_equal ( result , idx ) #NEWLINE# result = ( idx // 1 ) #NEWLINE# tm . assert_index_equal ( result , result ) #NEWLINE# result = ( idx * np . array ( 5 , dtype = 'int64' ) ) #NEWLINE# tm . assert_index_equal ( result , self . _holder ( ( np . arange ( 5 , dtype = 'int64' ) * 5 ) ) ) #NEWLINE# result = ( idx * np . arange ( 5 , dtype = 'int64' ) ) #NEWLINE# tm . assert_index_equal ( result , didx ) #NEWLINE# result = ( idx * Series ( np . arange ( 5 , dtype = 'int64' ) ) ) #NEWLINE# tm . assert_index_equal ( result , didx ) #NEWLINE# result = ( idx * Series ( ( np . arange ( 5 , dtype = 'float64' ) + 0.1 ) ) ) #NEWLINE# tm . assert_index_equal ( result , self . _holder ( ( np . arange ( 5 , dtype = 'float64' ) * ( np . arange ( 5 , dtype = 'float64' ) + 0.1 ) ) ) ) #NEWLINE# self . assertRaises ( TypeError , ( lambda : ( idx * idx ) ) ) #NEWLINE# self . assertRaises ( ValueError , ( lambda : ( idx * self . _holder ( np . arange ( 3 ) ) ) ) ) #NEWLINE# self . assertRaises ( ValueError , ( lambda : ( idx * np . array ( [ 1 , 2 ] ) ) ) )