0

I have a (1000,2) array and I was wondering how you can add a (1000,1) array without looping. What's the pythonic way to do this in numpy?

1 Answer 1

2

use numpy.hstack.

a = np.zeros((1000,2))
b = np.zeros((1000,1))
c = np.hstack((a,b))
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.