[Numpy-discussion] reshaping arrays

Sudheer Joseph sudheer.joseph at yahoo.com
Sat Mar 2 22:49:09 EST 2013

Thank you Brad,
for the quick reply with solution, special thanks to the link for matlab users.
with best regards,
Sudheer Joseph 
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.
Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
E-mail:sjo.India at gmail.com;sudheer.joseph at yahoo.com
Web- http://oppamthadathil.tripod.com

 From: Bradley M. Froehle <brad.froehle at gmail.com>
To: Discussion of Numerical Python <numpy-discussion at scipy.org> 
Sent: Sunday, 3 March 2013 8:50 AM
Subject: Re: [Numpy-discussion] reshaping arrays

On Sat, Mar 2, 2013 at 6:03 PM, Sudheer Joseph <sudheer.joseph at yahoo.com> wrote:

Hi all,
>        For a 3d array in matlab, I can do the below to reshape it before an eof analysis. Is there a way to do the same using numpy? Please help.
>[nlat,nlon,ntim ]=size(ssh);
>and afterwards

Yes, easy:
nlat, nlon, ntim = ssh.shape
tssh = ssh.reshape(nlat*nlon, ntim, order='F')
and afterwards
eofout = eofl.reshape(nlat, nlon, ntim, order='F')

You probably want to go read through http://www.scipy.org/NumPy_for_Matlab_Users.

NumPy-Discussion mailing list
NumPy-Discussion at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130303/ecc8cdad/attachment.html>

More information about the NumPy-Discussion mailing list