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

numpy-svn@scip... numpy-svn@scip...
Sat Feb 20 20:45:49 CST 2010


Author: ptvirtan
Date: 2010-02-20 20:45:48 -0600 (Sat, 20 Feb 2010)
New Revision: 8198

Modified:
   trunk/numpy/lib/index_tricks.py
Log:
3K: BUG: fix unravel_index integer division

Modified: trunk/numpy/lib/index_tricks.py
===================================================================
--- trunk/numpy/lib/index_tricks.py	2010-02-21 02:45:30 UTC (rev 8197)
+++ trunk/numpy/lib/index_tricks.py	2010-02-21 02:45:48 UTC (rev 8198)
@@ -78,7 +78,7 @@
     # [dcb,dc,d,1]
     dim_prod = _nx.cumprod([1] + list(dims)[:0:-1])[::-1]
     # Indices become [x/dcb % a, x/dc % b, x/d % c, x/1 % d]
-    return tuple(x/dim_prod % dims)
+    return tuple(x//dim_prod % dims)
 
 def ix_(*args):
     """



More information about the Numpy-svn mailing list