diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-11-15 13:06:21 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-15 13:06:21 -0600 |
commit | a631f5b3841d2a87af290c203be26a06eb280638 (patch) | |
tree | 8d1e56f7a662a134b1dd21c4663bc1df13bee4bd | |
parent | ff8b0b21e0f17dbcc94fc87ba1194dcbbbe15432 (diff) | |
parent | e85233f414ba7c7a20ec7c61e3733f666a0046fd (diff) | |
download | numpy-a631f5b3841d2a87af290c203be26a06eb280638.tar.gz |
Merge pull request #12391 from mattip/deprecate-unique
DEP: raise on a call to deprecated numpy.lib.function_base.unique
-rw-r--r-- | doc/release/1.16.0-notes.rst | 3 | ||||
-rw-r--r-- | numpy/lib/function_base.py | 19 |
2 files changed, 3 insertions, 19 deletions
diff --git a/doc/release/1.16.0-notes.rst b/doc/release/1.16.0-notes.rst index 4674c9948..3f7b7be32 100644 --- a/doc/release/1.16.0-notes.rst +++ b/doc/release/1.16.0-notes.rst @@ -59,6 +59,9 @@ Expired deprecations * NaT comparisons now return ``False`` without a warning, finishing a deprecation cycle begun in NumPy 1.11. +* ``np.lib.function_base.unique`` was removed, finishing a deprecation cycle + begun in NumPy 1.4. Use `numpy.unique` instead. + Compatibility notes =================== diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 07bdb92ba..5f87c8b2c 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1621,25 +1621,6 @@ def trim_zeros(filt, trim='fb'): last = last - 1 return filt[first:last] - -@deprecate -def unique(x): - """ - This function is deprecated. Use numpy.lib.arraysetops.unique() - instead. - """ - try: - tmp = x.flatten() - if tmp.size == 0: - return tmp - tmp.sort() - idx = concatenate(([True], tmp[1:] != tmp[:-1])) - return tmp[idx] - except AttributeError: - items = sorted(set(x)) - return asarray(items) - - def _extract_dispatcher(condition, arr): return (condition, arr) |