diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-06-23 22:43:08 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-06-23 22:43:08 +0000 |
commit | cf80c7230397288b9f0c7b448bd9fe0c500dc323 (patch) | |
tree | 165889b4c6531769847b43ec63455edf6717eb8b /numpy/lib/function_base.py | |
parent | 96b0a3aae9c5d509c7326b1ee101ac81fe65e52c (diff) | |
download | numpy-cf80c7230397288b9f0c7b448bd9fe0c500dc323.tar.gz |
Add code to descend through a field and increment (or decrement) any object reference counts.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 9a4b6b771..39ffa4c8e 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -452,13 +452,15 @@ def trim_zeros(filt, trim='fb'): return filt[first:last] def unique(inseq): - """Return unique items from a 1-dimensional sequence. + """Return unique items (in sorted order) from a 1-dimensional sequence. """ # Dictionary setting is quite fast. set = {} for item in inseq: set[item] = None - return asarray(set.keys()) + val = asarray(set.keys()) + val.sort() + return val def extract(condition, arr): """Return the elements of ravel(arr) where ravel(condition) is True |