Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,20 @@ def unique(values):

Returns
-------
numpy.ndarray, ExtensionArray or NumpyExtensionArray

The return can be:

* Index : when the input is an Index
* Categorical : when the input is a Categorical dtype
* ndarray : when the input is a Series/ndarray

Return numpy.ndarray, ExtensionArray or NumpyExtensionArray.
Index, ExtensionArray or numpy.ndarray
The return type depends on the type of the input:

* :class:`Index` : when the input is an :class:`Index`, the result is
an :class:`Index` (or a subclass such as :class:`DatetimeIndex`).
* :class:`ExtensionArray` : when the input has an
:class:`ExtensionDtype` (for example :class:`Categorical`,
tz-aware ``datetime64``, :class:`IntervalArray`, a masked
integer/boolean/float array, an Arrow-backed array, or
:class:`NumpyExtensionArray`), the result is an
:class:`ExtensionArray` of the same dtype.
* :class:`numpy.ndarray` : for any other input (a NumPy-dtype
:class:`Series`, a :class:`numpy.ndarray`, or any other 1-D
array-like), the result is a :class:`numpy.ndarray`.

See Also
--------
Expand Down
Loading