Skip to main content
1 of 3
hpaulj
  • 1.5k
  • 1
  • 9
  • 16
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.

hpaulj
  • 1.5k
  • 1
  • 9
  • 16