I want to randomly choose from an array but the requirement is that the elements of the output array will increase by one (and start at zero). For example, if I want to get 5 numbers between 0 and 5 then one could do
np.random.choice(np.arange(6), 5)
array([5, 0, 5, 2, 5])
where, in this case, I would like this to be:
array([2, 0, 2, 1, 2])
Another example, if
np.random.choice(np.arange(6), 5)
array([1, 1, 1, 4, 2])
I am trying to "rebase" this in such a manner that it will be
array([0, 0, 0, 2, 1])
Final example...select 15 numbers between 0 and 5
np.random.choice(np.arange(6), 15)
array([4, 5, 3, 0, 4, 5, 3, 0, 2, 5, 2, 3, 2, 4, 4])
where eventually I want to end up with
array([3, 4, 2, 0, 3, 4, 2, 0, 1, 4, 1, 2, 1, 3, 3])