1

arr = [12345, 12345, 12345, 12345] paths = [67890, 67890, 67890, 67890]

How can I combine these two numpy arrays to get this output below? output = [1234567890, 1234567890, 1234567890, 1234567890]

Don99
  • 209
  • 1
  • 2
  • 9
  • 1
    Does this answer your question? [Element-wise string concatenation in numpy](https://stackoverflow.com/questions/9958506/element-wise-string-concatenation-in-numpy) – obchardon Jul 06 '21 at 14:29

1 Answers1

1

IIUC, here's one way:

arr_list = [arr, paths]
result = np.apply_along_axis(''.join, 0, arr_list)
Nk03
  • 14,699
  • 2
  • 8
  • 22