Unique() to a certain tolerance?

You can use “trunc”:

data = rand(10)
unique(trunc.(data, digits = 4))
1 Like