#NEWLINE# def test_at_fill_value( 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 ( fill_value = 0 ) #NEWLINE# self . assertEqual ( sparse . at [ ( 'A' , 'x' ) ] , orig . at [ ( 'A' , 'x' ) ] ) #NEWLINE# self . assertTrue ( np . isnan ( sparse . at [ ( 'B' , 'z' ) ] ) ) #NEWLINE# self . assertTrue ( np . isnan ( sparse . at [ ( 'C' , 'y' ) ] ) ) #NEWLINE# self . assertEqual ( sparse . at [ ( 'D' , 'x' ) ] , orig . at [ ( 'D' , 'x' ) ] )