0

I'm trying to combine 4 arrays into one in the following fashion

a = ([1,5,9])
b = ([2,6,10])
c = ([3,7,11])
d = ([4,8,12])

combination = [[1,2,3,4][5,6,7,8][9,10,11,12]]

any help would be greatly appreaciated

1 Answers1

1
import numpy as np

a = ([1,5,9])
b = ([2,6,10])
c = ([3,7,11])
d = ([4,8,12])

print (np.stack((a,b,c,d), axis=-1))

Output:

[[ 1  2  3  4]
 [ 5  6  7  8]
 [ 9 10 11 12]]
Synthase
  • 5,849
  • 2
  • 12
  • 34