I have two arrays of the following dimensions: a = (6,1) b = (6,4) I wish to add array (a) as additional column to array (c).
Tried: c= np.column_stack([b,a]) and get an error due to mismatch of dimensions.
I have two arrays of the following dimensions: a = (6,1) b = (6,4) I wish to add array (a) as additional column to array (c).
Tried: c= np.column_stack([b,a]) and get an error due to mismatch of dimensions.
Try:
c = np.concatenate((b,a), axis=1)
This assumes that a.shape = (6,1)
. If a.shape = (6,)
then you can do:
c = np.concatenate((b,a.reshape((6,1))), axis=1)