I looked into the various concatenation methods a bit more to better
understand what's going on under the hood.
Here's essentially what these different methods do:
vstack(tup):
concatenate( map(atleast_2d,tup), axis=0 )
hstack(tup):
concatenate( map(atleast_1d,tup),axis=1 )
Bill Baxter schrieb:
Finally, I noticed that the atleast_nd methods return arrays
regardless of input type. At a minimum, atleast_1d and atleast_2d on
matrices should return matrices. I'm not sure about atleast_3d, since
matrices can't be 3d. (But my opinon is that the matrix type should
On 7/21/06, Sven Schreiber [EMAIL PROTECTED] wrote:
Bill Baxter schrieb:
Finally, I noticed that the atleast_nd methods return arrays
regardless of input type.
Are you sure? I reported that issue with *stack and I remember it was fixed.
Doh! My bad. You're right. I was looking at the
For 1-d inputs I think r_ should act like vstack, and c_ should act
like column_stack.
Currently r_ and c_ both act like hstack for 1-d inputs.
Background:
I keep getting bitten by the fact that this doesn't work:
a = array([1,2,3])
b = array([[1,2,3],[2,3,4]])
c = array([4,5,6])
r_[b,c]