[Numpy-discussion] Re: weird interaction: pickle, numpy, matplotlib.hist

Andrew Jaffe a.h.jaffe at gmail.com
Fri Apr 7 06:54:09 EDT 2006


Travis Oliphant wrote:
> But,  this brings up the point that currently the pickled raw-data which 
> is read-in as a string by Python is used as the memory for the new array 
> (i.e. the string memory is "stolen").    This should work.  The fact 
> that it didn't with sort was a bug that is now fixed in SVN.  However, 
> operations on out-of-byte-order arrays will always be slower.  Thus, 
> perhaps on pickle read the data should be copied to native byte-order if 
> necessary.

+1 from me, too. I assume that byteswapping is fast compared to I/O in 
most cases, and the only times when you wouldn't want it would be 
'advanced' usage that the developer could take control of via a custom 
reduce, __getstate__, __setstate__, etc.

Andrew


______________________________________________________________________
Andrew Jaffe                                    a.jaffe at imperial.ac.uk
Astrophysics Group                                    +44 207 594-7526
Blackett Laboratory, Room 1013                    FAX             7541
Imperial College, Prince Consort Road
London SW7 2AZ ENGLAND              http://astro.imperial.ac.uk/~jaffe






More information about the NumPy-Discussion mailing list