Skip to content

Commit 8871863

Browse files
committed
fixup! BUG: Fixed pd.unique on array of tuples
1 parent 40babf0 commit 8871863

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

doc/source/whatsnew/v0.20.2.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Bug Fixes
4141
detecting the terminal size. This fix only applies to python 3 (:issue:`16496`)
4242
- Bug in using ``pathlib.Path`` or ``py.path.local`` objects with io functions (:issue:`16291`)
4343
- Bug in ``DataFrame.update()`` with ``overwrite=False`` and ``NaN values`` (:issue:`15593`)
44-
- Bug in :func:`pd.unique` on an array of tuples (:issue:`16519`)
44+
- Bug in :func:`unique` on an array of tuples (:issue:`16519`)
4545

4646

4747
- Fixed a compatibility issue with IPython 6.0's tab completion showing deprecation warnings on Categoricals (:issue:`16409`)

pandas/core/algorithms.py

+5
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ def unique(values):
328328
[b, a, c]
329329
Categories (3, object): [a < b < c]
330330
331+
An array of tuples
332+
333+
>>> pd.unique([('a', 'b'), ('b', 'a'), ('a', 'c'), ('b', 'a')])
334+
array([('a', 'b'), ('b', 'a'), ('a', 'c')], dtype=object)
335+
331336
See Also
332337
--------
333338
pandas.Index.unique

0 commit comments

Comments
 (0)