Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Clarify that unique() promotes dtype to 64-bit #27869

Closed
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ def unique(values):
of appearance. This does NOT sort.

Significantly faster than numpy.unique. Includes NA values.
For numeric input, the dtype of the result will be promoted to 64-bit.

Parameters
----------
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,7 @@ def dropna(self, how="any"):
Returns
-------
Index without duplicates
For numeric input, the dtype of the result will be promoted to 64-bit.

See Also
--------
Expand Down
5 changes: 3 additions & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1910,8 +1910,9 @@ def unique(self):

Notes
-----
Returns the unique values as a NumPy array. In case of an
extension-array backed Series, a new
Returns the unique values as a NumPy array.
For numeric input, the dtype of the result will be promoted to 64-bit.
In case of an extension-array backed Series, a new
:class:`~api.extensions.ExtensionArray` of that type with just
the unique values is returned. This includes

Expand Down