On Thu, Jul 18, 2013 at 5:57 PM, Alan G Isaac <[email protected]> wrote: > > I'm floating this thought even though it is not fleshed out. > > On occasion, I run into the following problem: > I have a rectangular array A to which I want to append > a (probably) one dimensional vector b to make [A|b]. > Of course this can be done as np.hstack((x,b[:,None])) > (or obscurely np.r_['1,2,0',x,b]), but this has the following issues: > > - what if ``b`` turns out to be a list? > - what if ``b`` turns out to be 2d (e.g., a column vector)? > - it's a bit ugly > - it is not obvious when read by others (e.g., students)
np.column_stack([x, b]) does everything you need. -- Robert Kern
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
