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?
问问题
665 次
1 回答
2
use numpy.hstack
.
a = np.zeros((1000,2))
b = np.zeros((1000,1))
c = np.hstack((a,b))
于 2013-03-31T00:35:34.867 回答