Array of arrays (Python/NumPy)

I am using Python/NumPy, and I have two arrays like the following:

array1 = [1 2 3]
array2 = [4 5 6]

And I would like to create a new array:

array3 = [[1 2 3], [4 5 6]]

and append items to it. So for example if the new items to append are:

array4 = [7 8 9]
array5 = [10 11 12]

Then now array3 would be an array with two rows and two columns like the one shown below:

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

I seem to have problems because the elements of my arrays are not separated by commas.

Leave a Comment