#NEWLINE# def test_constructor_from_series( self ) : #NEWLINE# #INDENT# x = Series ( np . random . randn ( 10000 ) , name = 'a' ) #NEWLINE# x = x . to_sparse ( fill_value = 0 ) #NEWLINE# tm . assertIsInstance ( x , SparseSeries ) #NEWLINE# df = SparseDataFrame ( x ) #NEWLINE# tm . assertIsInstance ( df , SparseDataFrame ) #NEWLINE# x = Series ( np . random . randn ( 10000 ) , name = 'a' ) #NEWLINE# y = Series ( np . random . randn ( 10000 ) , name = 'b' ) #NEWLINE# x2 = x . astype ( float ) #NEWLINE# x2 . ix [ : 9998 ] = np . NaN #NEWLINE# x_sparse = x2 . to_sparse ( fill_value = np . NaN ) #NEWLINE# y . ix [ : 9998 ] = 0 #NEWLINE# y_sparse = y . to_sparse ( fill_value = 0 )