#NEWLINE# def test_dropna( self ) : #NEWLINE# #INDENT# sp = SparseSeries ( [ 0 , 0 , 0 , nan , nan , 5 , 6 ] , fill_value = 0 ) #NEWLINE# sp_valid = sp . valid ( ) #NEWLINE# expected = sp . to_dense ( ) . valid ( ) #NEWLINE# expected = expected [ ( expected != 0 ) ] #NEWLINE# tm . assert_almost_equal ( sp_valid . values , expected . values ) #NEWLINE# self . assertTrue ( sp_valid . index . equals ( expected . index ) ) #NEWLINE# self . assertEqual ( len ( sp_valid . sp_values ) , 2 ) #NEWLINE# result = self . bseries . dropna ( ) #NEWLINE# expected = self . bseries . to_dense ( ) . dropna ( ) #NEWLINE# self . assertNotIsInstance ( result , SparseSeries ) #NEWLINE# tm . assert_series_equal ( result , expected )