0

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.

1

1 Answer 1

1

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)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.