numpy / numpy/numpy

ENH: add `method` parameter to np.unique

Open
#30,876 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

01 - Enhancement
Dominant language
Python
Stars
32.8k
Forks
12.8k
Avg merge
1d 7h
Merged PRs (30d)
197

Description

Proposed new feature or change:

While hash based np.unique is being introduced, the existing sorting method can win in some situation.
By adding method option ("sort" or "hash") to np.unique, user can switch the method to use.
https://github.com/numpy/numpy/pull/30496#issue-3751697348
https://github.com/numpy/numpy/pull/30496#issuecomment-3951455442

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with np.unique and review the linked pull request and its discussion about hash-based unique behavior. Confirm the intended API and semantics for the "sort" and "hash" method values; the work is done when users can select either method through np.unique.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.