Something I can't figure out by reading the Python documentation and stackoverflow. Probably I'm thinking in the wrong direction..
Let's say I've a predefined 2D Numpy array as follow:
a = np.zeros(shape=(3,2))
print a
array([[ 0., 0.],
[ 0., 0.],
[ 0., 0.]])
Now I would like to populate each column of this 2D array with a 1D data array (one by one), as in:
b = np.array([1,2,3])
# Some code, that I just can't figure out. I've studied insert, column_stack,
# h_stack, append. Nothing seems to do what I need
print a
array([[ 1., 0.],
[ 2., 0.],
[ 3., 0.]])
c = np.array([4,5,6])
# Some code, that I just can't figure out. I've studied insert, column_stack,
# h_stack, append. Nothing seems to do what I need
print a
array([[ 1., 4.],
[ 2., 5.],
[ 3., 6.]])
Any suggestions would be appreciated!