By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,075 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,075 IT Pros & Developers. It's quick & easy.

Numpy and cPickle

P: n/a
Hi

If I cPickle a numpy array under Linux and un-cPickle it under Solaris
10, my arrays seem to be transposed. Is there any way to get the same
behavior on both platforms without testing which platform the python
script runs on and then transposing the array?

I am using python 2.4.2 and numpy 0.9.6 on both machines.

Thanks in advance

Martin
Apr 13 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Martin Manns wrote:
Hi

If I cPickle a numpy array under Linux and un-cPickle it under Solaris
10, my arrays seem to be transposed. Is there any way to get the same
behavior on both platforms without testing which platform the python
script runs on and then transposing the array?

I am using python 2.4.2 and numpy 0.9.6 on both machines.


Transposed? That's odd. There was a byteorder issue with pickles going across
differently-endianed platforms that was fixed in the past few days. Could you
come up with a small bit of code that shows the problem and post it and the
incorrect output to the bug tracker?

http://projects.scipy.org/scipy/numpy/newticket

Thank you!

--
Robert Kern
ro*********@gmail.com

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Apr 13 '06 #2

P: n/a
Robert Kern wrote:
Martin Manns wrote:

If I cPickle a numpy array under Linux and un-cPickle it under Solaris
10, my arrays seem to be transposed.

Transposed? That's odd. There was a byteorder issue with pickles going across
differently-endianed platforms that was fixed in the past few days. Could you
come up with a small bit of code that shows the problem and post it and the
incorrect output to the bug tracker?


Sorry, I my ad-hoc small example does not reproduce the error even
though the files generated on both platforms differ. I will try to set
up the code tomorrow.

Thank you though for the fast response

Martin
Apr 13 '06 #3

P: n/a
Martin Manns wrote:
Robert Kern wrote:
Martin Manns wrote:

If I cPickle a numpy array under Linux and un-cPickle it under Solaris
10, my arrays seem to be transposed.

Transposed? That's odd. There was a byteorder issue with pickles going across
differently-endianed platforms that was fixed in the past few days. Could you
come up with a small bit of code that shows the problem and post it and the
incorrect output to the bug tracker?


Sorry, I my ad-hoc small example does not reproduce the error even
though the files generated on both platforms differ. I will try to set
up the code tomorrow.


Somehow, the bug does not show up any more. I believe it was due to the
numpy version that is fetched by cPickle. Is there any way to control
(or even determine), which library version cPickle grabs for unpickling
a numpy array (numpy, scipy, etc)?

Apr 16 '06 #4

P: n/a
Mr. M wrote:
Somehow, the bug does not show up any more. I believe it was due to the
numpy version that is fetched by cPickle. Is there any way to control
(or even determine), which library version cPickle grabs for unpickling
a numpy array (numpy, scipy, etc)?


You can import the appropriate module first. Then it will be in sys.modules and
be picked up during unpickling. You may have to do some sys.path manipulation if
you have more than one version lieing about on your filesystem.

--
Robert Kern
ro*********@gmail.com

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Apr 16 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.