Extend a bit to "Add a list of lines to a list of lines":
import numpy as np lst1 = ['a','b','c','d','e'] lst2 = ['1','2','3','4','5'] at = np.full(fill_value='@',shape=len(lst1),dtype=object) #optional third list result = np.array(lst1,dtype=object)+at+np.array(lst2,dtype=object)
Result:
array(['a@1', 'b@2', 'c@3', 'd@4', 'e@5'], dtype=object)
The dtype object can be further converted
Artur Sokolovsky Aug 14 '18 at 9:30 2018-08-14 09:30
source share