On Wed, Mar 30, 2011 at 1:42 PM, gary ruben wrote:
> You're right, they are not equivalent. vstack will happily create an
> array of higher rank than the parts it is stacking, whereas
> concatenate requires the arrays it is working with to already be at
> least 2d, so the equivalent is
> np.concat
You're right, they are not equivalent. vstack will happily create an
array of higher rank than the parts it is stacking, whereas
concatenate requires the arrays it is working with to already be at
least 2d, so the equivalent is
np.concatenate((np.arange(5.)[newaxis],np.arange(5.)[newaxis]), axis=0)
Dear List,
I have a quick question regarding vstack and concatenate.
In the docs for vstack it says that:
np.concatenate(tup, axis=0)
should be equivalent to:
np.vstack(tup)
However, I tried this out and it doesn't seem to be case, i.e.
>>> np.vstack((np.arange(5.), np.arange(5.)))
array([[ 0.