[Numpy-discussion] numpy.reshape() bug?
Mon Sep 28 15:39:28 CDT 2009
I am trying to "collapse" two dimensions of a 3-D array, using reshape:
(Pdb) dims = np.shape(trace)
Out: (1000, 4, 3)
(Pdb) newdims = (dims, sum(dims[1:]))
Out: (1000, 7)
However, reshape seems to think I am missing something:
(Pdb) np.reshape(trace, newdims)
*** ValueError: total size of new array must be unchanged
Clearly the total size of the new array *is* unchanged.
More information about the NumPy-Discussion