diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2006-09-28 16:22:43 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2006-09-28 16:22:43 +0000 |
commit | c9eba748246a0f1d1e93c587eb4d62c185cdc20a (patch) | |
tree | e6c3a45606abfd02db01883bf944c9e46bb35f35 /numpy/lib/arraysetops.py | |
parent | 5a490d046ae11869f1588fc5514c394218c71713 (diff) | |
download | numpy-c9eba748246a0f1d1e93c587eb4d62c185cdc20a.tar.gz |
Change unique1d's argument name from retindx to return_index.
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r-- | numpy/lib/arraysetops.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index 6c5115582..a5786ca52 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -48,16 +48,18 @@ def ediff1d(ary, to_end = None, to_begin = None): ## # 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 |