Loading and saving arbitrary objects with attributes

Hi.

Does anyone know how to save and load an arbitrary object (e.g a numpy
array) to a file, and load it again?

I cannot use savetxt and loadtxt as these only stores the numbers. I
think I'm looking for some binary format.

Best regards / Med Venlig Hilsen
Troels Kofoed Jacobsen

Have you tried to pickle your object w/ cPickle ?

ยทยทยท

On Wednesday 26 March 2008 07:16:37 Troels Kofoed Jacobsen wrote:

Hi.

Does anyone know how to save and load an arbitrary object (e.g a numpy
array) to a file, and load it again?