[Numpy-discussion] "ValueError: total size of new array must be unchanged" only on Windows
Sun Feb 5 11:47:03 CST 2012
On Sun, Feb 5, 2012 at 12:39 PM, Paolo <firstname.lastname@example.org> wrote:
> This is my code:
my guess would be, that you have to strip the line endings \n versus \r\n
> matrix=np.fromstring(matrix, dtype=np.int16)
> Il 05/02/2012 17:21, Olivier Delalleau ha scritto:
> It means there is some of your code that is not entirely
> platform-independent. It's not possible to tell you which part because you
> didn't provide your code. The problem may not even be numpy-related.
> So you should first look at the current shape of 'matrix', and what are
> the values of a, b and c, then see where the discrepancy is, and work from
> -=- Olivier
> Le 5 février 2012 11:16, Paolo Zaffino <email@example.com> a écrit :
>> Yes, I understand this but I don't know because on Linux and Mac it
>> works well.
>> If the matrix size is different it should be different indipendently from
>> os type.
>> Am I wrong?
>> Thanks for your support!
>> * From: * Olivier Delalleau <firstname.lastname@example.org>;
>> * To: * Discussion of Numerical Python <email@example.com>;
>> * Subject: * Re: [Numpy-discussion] "ValueError: total size of new array
>> must be unchanged" only on Windows
>> * Sent: * Sun, Feb 5, 2012 3:02:44 PM
>> It should mean that matrix.size != a * b * c.
>> -=- Olivier
>> Le 5 février 2012 09:32, Paolo <firstname.lastname@example.org> a écrit :
>>> I wrote a function that works on a numpy matrix and it works fine on Mac
>>> OS and GNU/Linux (I didn't test it on python 3).
>>> Now I have a problem with numpy: the same python file doesn't work on
>>> Windows (Windows xp, python 2.7 and numpy 2.6.1).
>>> I get this error:
>>> matrix=matrix.reshape(a, b, c)
>>> ValueError: total size of new array must be unchanged
>>> Why? Do anyone have an idea about this?
>>> Thank you very much.
>>> NumPy-Discussion mailing list
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion