rand = np.random.random((15,2)) # shape is (15,2)
vals = np.array([0,3,5]) # shape is (3,)
res = np.concatenate(([np.full((rand.shape[0]//vals.shape[0],), val) for val in vals]), axis=0)
res
output:
array([0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5])
Finally,
final = np.hstack((rand, res.reshape(15,1)))
final
output:
array([[0.29759807, 0.60548479, 0. ],
[0.61242249, 0.46456274, 0. ],
[0.86172011, 0.2963868 , 0. ],
[0.91728575, 0.36366023, 0. ],
[0.56488556, 0.82130321, 0. ],
[0.59482141, 0.46148353, 3. ],
[0.7762271 , 0.25415058, 3. ],
[0.09176551, 0.9687253 , 3. ],
[0.06473259, 0.34686598, 3. ],
[0.69542414, 0.15540001, 3. ],
[0.02880707, 0.23169327, 5. ],
[0.90004256, 0.22145591, 5. ],
[0.61596969, 0.46807342, 5. ],
[0.02263769, 0.68522023, 5. ],
[0.81777274, 0.58145853, 5. ]])