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
9 changes: 3 additions & 6 deletions base/multidimensional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1294,14 +1294,11 @@ end
hash(x::Prehashed) = x.hash

"""
unique(A::AbstractArray[, dim::Int])
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`.
Return unique regions of `A` along dimension `dim`.

# Examples

```jldoctest
julia> A = map(isodd, reshape(collect(1:8), (2,2,2)))
Expand Down
8 changes: 6 additions & 2 deletions base/set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ 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.

# Example

```jldoctest
julia> unique([1; 2; 2; 6])
julia> unique([1, 2, 6, 2])
3-element Array{Int64,1}:
1
2
Expand Down Expand Up @@ -182,8 +184,10 @@ end
Returns an array containing one value from `itr` for each unique value produced by `f`
applied to elements of `itr`.

# Example

```jldoctest
julia> unique(isodd, [1; 2; 2; 6])
julia> unique(isodd, [1, 2, 6, 2])
2-element Array{Int64,1}:
1
2
Expand Down