#NEWLINE# def test_from_csv( self ) : #NEWLINE# #INDENT# with ensure_clean ( ) as path : #NEWLINE# #INDENT# self . ts . to_csv ( path ) #NEWLINE# ts = Series . from_csv ( path ) #NEWLINE# assert_series_equal ( self . ts , ts , check_names = False ) #NEWLINE# self . assertTrue ( ( ts . name is None ) ) #NEWLINE# self . assertTrue ( ( ts . index . name is None ) ) #NEWLINE# self . ts . to_csv ( path , header = True ) #NEWLINE# ts_h = Series . from_csv ( path , header = 0 ) #NEWLINE# self . assertTrue ( ( ts_h . name == 'ts' ) ) #NEWLINE# self . series . to_csv ( path ) #NEWLINE# series = Series . from_csv ( path ) #NEWLINE# self . assertIsNone ( series . name ) #NEWLINE# self . assertIsNone ( series . index . name ) #NEWLINE# assert_series_equal ( self . series , series , check_names = False ) #NEWLINE# self . assertTrue ( ( series . name is None ) ) #NEWLINE# self . assertTrue ( ( series . index . name is None ) ) #NEWLINE# self . series . to_csv ( path , header = True ) #NEWLINE# series_h = Series . from_csv ( path , header = 0 ) #NEWLINE# self . assertTrue ( ( series_h . name == 'series' ) ) #NEWLINE# outfile = open ( path , 'w' ) #NEWLINE# outfile . write ( '1998-01-01|1.0\n1999-01-01|2.0' ) #NEWLINE# outfile . close ( ) #NEWLINE# series = Series . from_csv ( outfile , sep = '|' ) #NEWLINE# checkseries = Series ( { #NEWLINE# #INDENT# datetime ( 1998 , 1 , 1 ) : 1.0 , #NEWLINE# datetime ( 1999 , 1 , 1 ) : 2.0 , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert_series_equal ( checkseries , series ) #NEWLINE# series = Series . from_csv ( path , sep = '|' , parse_dates = False ) #NEWLINE# checkseries = Series ( { #NEWLINE# #INDENT# '1998-01-01' : 1.0 , #NEWLINE# '1999-01-01' : 2.0 , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert_series_equal ( checkseries , series )