So I want to concatenate two arrays but by pairs. The input is as follows:
a = array([1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) b = array([0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]) And the output should be as follows:
out_put = [[1, 0], [1, 0], [0, 1], [1, 0], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [1, 0]] I managed to get such result by iterating over the two arrays
out_put = [[a[i],b[i]] for i in range(len(a)] but I wonder if there any faster way .
Thank you