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

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Sep 28 11:23:50 CDT 2006


Author: stefan
Date: 2006-09-28 11:22:43 -0500 (Thu, 28 Sep 2006)
New Revision: 3232

Modified:
   trunk/numpy/lib/arraysetops.py
Log:
Change unique1d's argument name from retindx to return_index.


Modified: trunk/numpy/lib/arraysetops.py
===================================================================
--- trunk/numpy/lib/arraysetops.py	2006-09-28 15:56:19 UTC (rev 3231)
+++ trunk/numpy/lib/arraysetops.py	2006-09-28 16:22:43 UTC (rev 3232)
@@ -48,16 +48,18 @@
 ##
 # 01.11.2005, c
 # 02.11.2005
-def unique1d(ar1, retindx=False):
-    """Unique elements of 1D array. When ret_indx is True, return also the
-    indices indx such that ar1.flat[indx] is the resulting array of unique
-    elements."""
+def unique1d(ar1, return_index=False):
+    """Unique elements of 1D array. When return_index is True, return
+    also the indices indx such that ar1.flat[indx] is the resulting
+    array of unique elements.
+    
+    """
     ar = numpy.asarray(ar1).ravel()
     if ar.size == 0:
-        if retindx: return numpy.empty(0, numpy.bool), ar
+        if return_index: return numpy.empty(0, numpy.bool), ar
         else: return ar
     
-    if retindx:
+    if return_index:
         perm = ar.argsort()
         aux = ar.take(perm)
         flag = ediff1d(aux, 1) != 0



More information about the Numpy-svn mailing list