Given an array of integer counts c, how can I transform that into an array of integers inds such that np.all(np.bincount(inds) == c) i
c
inds
np.all(np.bincount(inds) == c)
no numpy needed :
c = [1,3,2,2] reduce(lambda x,y: x + [y] * c[y], range(len(c)), [])