np.array([' '.join( np.repeat(x, z)) for z in y ])
repeat
handles the repetition part for row of y
nicely. The rest is just iteration on the rows. We don't need the generality of apply_along_axis
here.
np.array([' '.join( np.repeat(x, z)) for z in y ])
repeat
handles the repetition part for row of y
nicely. The rest is just iteration on the rows. We don't need the generality of apply_along_axis
here.