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

document unique(i -> a[i], eachindex(a)) trick #45291

Merged
merged 4 commits into from
May 16, 2022
Merged

Conversation

stevengj
Copy link
Member

As noted in #1845, indices of unique elements in a can be computed with unique(i -> a[i], eachindex(a)), and this PR adds that as an example in the documentation as suggested by @nalimilan .

This is equivalent to the second output of the Matlab unique function or to to return_index=True in numpy.unique.

@stevengj stevengj added the docs This change adds or pertains to documentation label May 12, 2022
base/set.jl Outdated Show resolved Hide resolved
base/set.jl Show resolved Hide resolved
base/set.jl Outdated Show resolved Hide resolved
stevengj and others added 2 commits May 13, 2022 07:45
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
@KristofferC KristofferC added the merge me PR is reviewed. Merge when all tests are passing label May 13, 2022
@KristofferC KristofferC merged commit 6962c91 into master May 16, 2022
@KristofferC KristofferC deleted the stevengj-patch-1 branch May 16, 2022 12:06
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants