#NEWLINE# def test_iat( self ) : #NEWLINE# #INDENT# orig = pd . DataFrame ( [ [ 1 , np . nan , 0 ] , [ 2 , 3 , np . nan ] , [ 0 , np . nan , 4 ] , [ 0 , np . nan , 5 ] ] , index = list ( 'ABCD' ) , columns = list ( 'xyz' ) ) #NEWLINE# sparse = orig . to_sparse ( ) #NEWLINE# self . assertEqual ( sparse . iat [ ( 0 , 0 ) ] , orig . iat [ ( 0 , 0 ) ] ) #NEWLINE# self . assertTrue ( np . isnan ( sparse . iat [ ( 1 , 2 ) ] ) ) #NEWLINE# self . assertTrue ( np . isnan ( sparse . iat [ ( 2 , 1 ) ] ) ) #NEWLINE# self . assertEqual ( sparse . iat [ ( 2 , 0 ) ] , orig . iat [ ( 2 , 0 ) ] ) #NEWLINE# self . assertTrue ( np . isnan ( sparse . iat [ ( ( - 1 ) , ( - 2 ) ) ] ) ) #NEWLINE# self . assertEqual ( sparse . iat [ ( ( - 1 ) , ( - 1 ) ) ] , orig . iat [ ( ( - 1 ) , ( - 1 ) ) ] )