#NEWLINE# def test_numpy_ufuncs( self ) : #NEWLINE# #INDENT# for ( name , idx ) in compat . iteritems ( self . indices ) : #NEWLINE# #INDENT# for func in [ np . exp , np . exp2 , np . expm1 , np . log , np . log2 , np . log10 , np . log1p , np . sqrt , np . sin , np . cos , np . tan , np . arcsin , np . arccos , np . arctan , np . sinh , np . cosh , np . tanh , np . arcsinh , np . arccosh , np . arctanh , np . deg2rad , np . rad2deg ] : #NEWLINE# #INDENT# if isinstance ( idx , pd . tseries . base . DatetimeIndexOpsMixin ) : #NEWLINE# #INDENT# with tm . assertRaises ( Exception ) : #NEWLINE# #INDENT# func ( idx ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( idx , ( Float64Index , Int64Index ) ) : #NEWLINE# #INDENT# result = func ( idx ) #NEWLINE# exp = Index ( func ( idx . values ) , name = idx . name ) #NEWLINE# self . assert_index_equal ( result , exp ) #NEWLINE# self . assertIsInstance ( result , pd . Float64Index ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( idx ) == 0 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# with tm . assertRaises ( Exception ) : #NEWLINE# #INDENT# func ( idx ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# for func in [ np . isfinite , np . isinf , np . isnan , np . signbit ] : #NEWLINE# #INDENT# if isinstance ( idx , pd . tseries . base . DatetimeIndexOpsMixin ) : #NEWLINE# #INDENT# with tm . assertRaises ( Exception ) : #NEWLINE# #INDENT# func ( idx ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( idx , ( Float64Index , Int64Index ) ) : #NEWLINE# #INDENT# result = func ( idx ) #NEWLINE# exp = func ( idx . values ) #NEWLINE# self . assertIsInstance ( result , np . ndarray ) #NEWLINE# tm . assertNotIsInstance ( result , Index ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( idx ) == 0 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# with tm . assertRaises ( Exception ) : #NEWLINE# #INDENT# func ( idx )