import numpy as np
array = ([a,b,c],[a,b,c])
array2 = ([1,2,3],[1,2,3])
concatenate_arrays = np. concatenate(array,array2)
#expected:[a,1,b,2,c,3]
#i want:[[[a,b,c] [1,2,3]],[[a,b,c] [1,2,3]]]
答案 0 :(得分:0)
我猜你要搜索的是zip ...
import numpy as np
array = (['a','b','c'],['a','b','c'])
array2 = ([1,2,3],[1,2,3])
np.array(list(zip(array, array2)))
...返回
array([[['a', 'b', 'c'],
['1', '2', '3']],
[['a', 'b', 'c'],
['1', '2', '3']]])