#NEWLINE# def test_fillna( self ) : #NEWLINE# #INDENT# s = SparseArray ( [ 1 , np . nan , np . nan , 3 , np . nan ] ) #NEWLINE# res = s . fillna ( ( - 1 ) ) #NEWLINE# exp = SparseArray ( [ 1 , ( - 1 ) , ( - 1 ) , 3 , ( - 1 ) ] , fill_value = ( - 1 ) ) #NEWLINE# tm . assert_sp_array_equal ( res , exp ) #NEWLINE# s = SparseArray ( [ 1 , np . nan , np . nan , 3 , np . nan ] , fill_value = 0 ) #NEWLINE# res = s . fillna ( ( - 1 ) ) #NEWLINE# exp = SparseArray ( [ 1 , ( - 1 ) , ( - 1 ) , 3 , ( - 1 ) ] , fill_value = 0 ) #NEWLINE# tm . assert_sp_array_equal ( res , s ) #NEWLINE# s = SparseArray ( [ 1 , np . nan , 0 , 3 , 0 ] ) #NEWLINE# res = s . fillna ( ( - 1 ) ) #NEWLINE# exp = SparseArray ( [ 1 , ( - 1 ) , 0 , 3 , 0 ] , fill_value = ( - 1 ) ) #NEWLINE# tm . assert_sp_array_equal ( res , exp ) #NEWLINE# s = SparseArray ( [ 1 , np . nan , 0 , 3 , 0 ] , fill_value = 0 ) #NEWLINE# res = s . fillna ( ( - 1 ) ) #NEWLINE# exp = SparseArray ( [ 1 , ( - 1 ) , 0 , 3 , 0 ] , fill_value = 0 ) #NEWLINE# tm . assert_sp_array_equal ( res , exp ) #NEWLINE# s = SparseArray ( [ np . nan , np . nan , np . nan , np . nan ] ) #NEWLINE# res = s . fillna ( ( - 1 ) ) #NEWLINE# exp = SparseArray ( [ ( - 1 ) , ( - 1 ) , ( - 1 ) , ( - 1 ) ] , fill_value = ( - 1 ) ) #NEWLINE# tm . assert_sp_array_equal ( res , exp ) #NEWLINE# s = SparseArray ( [ np . nan , np . nan , np . nan , np . nan ] , fill_value = 0 ) #NEWLINE# res = s . fillna ( ( - 1 ) ) #NEWLINE# exp = SparseArray ( [ ( - 1 ) , ( - 1 ) , ( - 1 ) , ( - 1 ) ] , fill_value = 0 ) #NEWLINE# tm . assert_sp_array_equal ( res , exp ) #NEWLINE# s = SparseArray ( [ 0 , 0 , 0 , 0 ] ) #NEWLINE# res = s . fillna ( ( - 1 ) ) #NEWLINE# exp = SparseArray ( [ 0 , 0 , 0 , 0 ] , fill_value = ( - 1 ) ) #NEWLINE# tm . assert_sp_array_equal ( res , exp ) #NEWLINE# s = SparseArray ( [ 0 , 0 , 0 , 0 ] , fill_value = 0 ) #NEWLINE# res = s . fillna ( ( - 1 ) ) #NEWLINE# exp = SparseArray ( [ 0 , 0 , 0 , 0 ] , fill_value = 0 ) #NEWLINE# tm . assert_sp_array_equal ( res , exp )