I want to make an array that looks something like
[0, 0, 0, 1, 1 , 1, 2, 2, 2,  . . .etc]
or
[4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, . . . etc]
There is something like
segments = [i for i in range(32)]  
which will make
 [ 1, 2, 3, 4, 5, . . . etc]
There are ways where I can call 3 separate sets of i in range(32) but I am looking to save computation by only calling it once. 
What's the most computationally efficient and programatically elegant way of making array like
[0, 0, 0, 1, 1 , 1, 2, 2, 2,  . . .etc]
 
     
     
     
     
    