Skip to content
Merged
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
11 changes: 7 additions & 4 deletions base/multidimensional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1302,11 +1302,14 @@ end
hash(x::Prehashed) = x.hash

"""
unique(itr[, dim])
unique(A::AbstractArray[, dim::Int])

Return an array containing only the unique elements of `A`, as determined by
[`isequal`](@ref), in the order that the first of each set of equivalent elements
originally appears.

If `dim` is specified, return unique regions of `A` along dimension `dim`.

Returns an array containing only the unique elements of the iterable `itr`, in
the order that the first of each set of equivalent elements originally appears.
If `dim` is specified, returns unique regions of the array `itr` along `dim`.

```jldoctest
julia> A = map(isodd, reshape(collect(1:8), (2,2,2)))
Expand Down
5 changes: 3 additions & 2 deletions base/set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ const ⊆ = issubset
"""
unique(itr)

Returns an array containing one value from `itr` for each unique value,
as determined by [`isequal`](@ref).
Return an array containing only the unique elements of collection `itr`,
as determined by [`isequal`](@ref), in the order that the first of each
set of equivalent elements originally appears.

```jldoctest
julia> unique([1; 2; 2; 6])
Expand Down