Hi All,
I am finding unique rows in a DataFrame and get number of repeat of unique rows, I could get by this:
t=DataFrame(a=rand(1:5,20),b=rand([:x,:y,:z],20))
ut=unique(t)
Int[countnz([t[j,:]==ut[i,:] for j in 1:size(t,1)]) for i in 1:size(ut,1)]
but I am wondering if there are more clean way, such as
Int[countnz(t.==r) for r in t]
or
Int[countnz(t.==r) for r in eachrow(t)]
right now, none of the above works, however it came to me as a natural way to broadcast each row and compare.
any thoughts?