<div dir="ltr">On Sat, Mar 2, 2013 at 6:03 PM, Sudheer Joseph <span dir="ltr">&lt;<a href="mailto:sudheer.joseph@yahoo.com" target="_blank">sudheer.joseph@yahoo.com</a>&gt;</span> wrote:<br><div><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif">
<div><span><font size="1"><div>Hi all,</div><div>        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.</div><div><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif">
[nlat,nlon,ntim ]=size(ssh);</div><div>tssh=reshape(ssh,nlat*nlon,ntim);</div></font></span></div><div style="font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif;font-size:12pt"></div><div style="font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif;font-size:12pt">
and afterwards</div><div style="font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif;font-size:12pt">eofout=[]</div><div>eofout=reshape(eof1,nlat,nlon,ntime)</div></div></div></blockquote><div><br></div><div style>
Yes, easy:</div><div style><br></div>nlat, nlon, ntim = ssh.shape<div>tssh = ssh.reshape(nlat*nlon, ntim, order=&#39;F&#39;)</div><div><div class="gmail_extra">and afterwards</div></div><div style>eofout = eofl.reshape(nlat, nlon, ntim, order=&#39;F&#39;)</div>
<div style><br></div><div style>You probably want to go read through <a href="http://www.scipy.org/NumPy_for_Matlab_Users">http://www.scipy.org/NumPy_for_Matlab_Users</a>.</div><div style><br></div><div style>Cheers,</div>
<div style>Brad</div></div></div></div></div>