See Unique (indices) method similar to MATLAB — for example, if you have a matrix a and you want the rows corresponding to whether columns 1 and 2 are unique, you could do:
Big Thx, But apart from the columns I showed, I have others columns that I cannot lose. How to select entire unique rows of columns 2 and 3 from a 3-column matrix. Another way is how to get the numbers of unique rows mat[:,2:3]? julia> mat
20Ă—3 Matrix{Any}:
“aa” “aa” “”
“Aachen” “Aachen” “nazwa_geograficzna”
“AAP” “AAP” “nazwa_instytucji”
“Aarona” “Aaron” “imię”
“Aaron” “Aaron” “imię”
“Aaronach” “Aaron” “imię”
“Aaronami” “Aaron” “imię”
“Aaronem” “Aaron” “imię”
“Aaroni” “Aaron” “imię”
“Aaronie” “Aaron” “imię”
“Aaronom” “Aaron” “imię”
“Aaronowi” “Aaron” “imię”
“Aaronowie” “Aaron” “imię”
“Aaronów” “Aaron” “imię”
“Aarony” “Aaron” “imię”
“aaronowa” “aaronowy” “”
“aaronową” “aaronowy” “”
“aaronowe” “aaronowy” “”
“aaronowego” “aaronowy” “”
“aaronowej” “aaronowy” “”
function runique(m, cols)
idx=Vector{Int}(undef,size(m, 1))
u=NaN
ui=1
for r in axes(m, 1)
if u!= @view m[r,cols]
idx[ui]=r
ui+=1
u= @view m[r,cols]
end
end
@views m[idx[1:ui-1],:]
end
using DataFrames
df=DataFrame(m,:auto)
combine(first,groupby(df,[:x2,:x3]))