[NUMPY] "ValueError: total size of new array must be unchanged" just on Windows

Nobody nobody at nowhere.com
Mon Oct 10 01:35:22 EDT 2011


On Sun, 09 Oct 2011 13:59:11 -0700, Paolo Zaffino wrote:

> 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?

What it says. The reshape()d array must have the same total number of
elements as the original array.

If it works on one platform and not on another, that indicates that either
"matrix" has a different shape on different platforms, or a*b*c is
different on different platforms.

As no-one here (except you) has any idea how matrix, a, b and c are
getting their values, it's impossible for us to say why they're getting
different values on different platforms.




More information about the Python-list mailing list