________________________________________ From: Tutor [tutor-bounces+sjeik_appie=hotmail....@python.org] on behalf of Alan Gauld via Tutor [tutor@python.org] Sent: Tuesday, July 4, 2017 8:37 AM To: tutor@python.org Subject: Re: [Tutor] [Python2.7] Convert (2,188,1) into (188,1)
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) Assuming this is a numpy array: If you want a 1D array you can use ravel (faster) or flatten (better name IMHO): https://docs.scipy.org/doc/numpy/reference/generated/numpy.ravel.html arr.reshape(2*188, 1) may also work. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor