[Numpy-svn] r4050 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Wed Sep 19 21:29:59 CDT 2007


Author: oliphant
Date: 2007-09-19 21:29:24 -0500 (Wed, 19 Sep 2007)
New Revision: 4050

Modified:
   trunk/numpy/lib/twodim_base.py
Log:
Fix so that rot90 only works on first two axes.

Modified: trunk/numpy/lib/twodim_base.py
===================================================================
--- trunk/numpy/lib/twodim_base.py	2007-09-20 02:08:54 UTC (rev 4049)
+++ trunk/numpy/lib/twodim_base.py	2007-09-20 02:29:24 UTC (rev 4050)
@@ -36,9 +36,9 @@
         raise ValueError, "Input must >= 2-d."
     k = k % 4
     if k == 0: return m
-    elif k == 1: return fliplr(m).transpose()
+    elif k == 1: return fliplr(m).swapaxes(0,1)
     elif k == 2: return fliplr(flipud(m))
-    else: return fliplr(m.transpose())  # k==3
+    else: return fliplr(m.swapaxes(0,1))  # k==3
 
 def eye(N, M=None, k=0, dtype=float):
     """ eye returns a N-by-M 2-d array where the  k-th diagonal is all ones,



More information about the Numpy-svn mailing list