[Tutor] [Python2.7] Convert (2,188,1) into (188,1)
alan.gauld at yahoo.co.uk
Tue Jul 4 04:37:46 EDT 2017
On 28/06/17 16:48, Allan Tanaka via Tutor wrote:
> Hi. I have array shape like: (2,188,1).
I assume this is a numpy array rather than the standard
library array? If so consider asking on the scipy/numpy
support forum for more specialised help.
> I want to make it like this: (188,1). I try that
> using .reshape(188,1)
.reshape() is not a valid function name. What object
are you attaching it to?
Show us at least a code snippet so we don't need
to guess. We need to see how you create the initial
array, then how you try to use reshape. Ideally a short
but complete example that exhibits the problem.
> but throws an error: total size of an array must be unchanged
Show us the full error trace, they contain a lot of information.
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:
More information about the Tutor