Skip to main content

list manipulation - quantilization (if that is a word)


Suppose I have a list of data, and a list of quantiles ({0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9} is a perennial favorite), and I want to assign to each element the quantile it is in (so for Range[100], the first ten numbers will be in the 0th quantile, I guess, the second ten in the first, and so on). Now, there is a way of doing this by ranking all the data by PermutationList[FindPermutation[Ordering[mydata]]], and then operating with the ranking, but this seems clumsy. Any slicker way?




Comments