Jun-20-2022, 04:11 PM
import numpy as np arr1 = np.array([1, 2, 3, 4, 5, 6, 7]) arr2 = np.array(['n', 'b', 'c', 'y', 'f', 'j', 'p']) l = np.stack((arr1, arr2), axis=1) print(l)the output is:
[['1','n'] ['2', 'b'] ['3','c'] ['4','y']['5','f'] ['6','j'] ['7','p']]
i would like that the types will be like the input so that the output will be:
[[1,'n'] [2, 'b'] [3,'c'] [4,'y'][ 5,'f'] [6,'j'] [7,'p']]