How to replace multiple values in an large array with the occurrence of the value?

Or more succinctly:

blobs_occ = countmap(vec(blobs))
[blobs_occ[value] for value in blobs]

Edit: and the same in one line, though less readable I think:

getindex.(Ref(countmap(vec(blobs))), blobs)
5 Likes