I want to increase the frequency of each element of an array with particular amount?
This is sample array;

I want it increase the frequency of each element by constant (taking 4 here);
[64,64,64,64, 45, 45, 45, 45, 56, 56, 56, 56, 67, 67, 67, 67, 78, 78, 78, 78, 12, 12, 12, 12, 112, 112, 112, 112, 232, 232, 232, 232]
Can anyone help me with this? Please it should not be hardcoded

You can use np.repeat to achieve this:
&gt;&gt;&gt; a.repeat(4)
array([ 64,  64,  64,  64,  45,  45,  45,  45,  56,  56,  56,  56,  67,
        67,  67,  67,  78,  78,  78,  78,  12,  12,  12,  12, 112, 112,
       112, 112, 232, 232, 232, 232])

