#NEWLINE# def rountrip_archive( N , K = 50 , iterations = 10 ) : #NEWLINE# #INDENT# arr = np . random . randn ( N , K ) #NEWLINE# dma = pandas . DataFrame ( arr , DatetimeIndex ( '1/1/2000' , periods = N , offset = datetools . Minute ( ) ) ) #NEWLINE# dma [ 201 ] = 'bar' #NEWLINE# filename_numpy = '/Users/wesm/tmp/numpy.npz' #NEWLINE# filename_larry = '/Users/wesm/tmp/archive.hdf5' #NEWLINE# filename_pandas = '/Users/wesm/tmp/pandas_tmp' #NEWLINE# try : #NEWLINE# #INDENT# os . unlink ( filename_numpy ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# os . unlink ( filename_larry ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# os . unlink ( filename_pandas ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# pandas_f = ( lambda : pandas_roundtrip ( filename_pandas , dma , dma ) ) #NEWLINE# pandas_time = ( timeit ( pandas_f , iterations ) / iterations ) #NEWLINE# print ( ( 'pandas (HDF5) %7.4f seconds' % pandas_time ) ) #NEWLINE# pickle_f = ( lambda : pandas_roundtrip ( filename_pandas , dma , dma ) ) #NEWLINE# pickle_time = ( timeit ( pickle_f , iterations ) / iterations ) #NEWLINE# print ( ( 'pandas (pickle) %7.4f seconds' % pickle_time ) ) #NEWLINE# try : #NEWLINE# #INDENT# os . unlink ( filename_numpy ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# os . unlink ( filename_larry ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# os . unlink ( filename_pandas ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass