On Tue, Jul 20, 2010 at 10:35 AM, Gael Varoquaux
<gael.varoqu...@normalesup.org> wrote:
> On Tue, Jul 20, 2010 at 10:24:56AM -0400, Skipper Seabold wrote:
>> Will one of the stack functions do?  I take it your a looks something like
>
>> a = [np.arange(1000), np.arange(1000), np.arange(1000)]
>
>> np.all(np.vstack(a) == np.concatenate([a_[None] for a_ in a]))
>> # True
>
> Works only for 1D arrays:
>
> In [3]: b = np.arange(100).reshape((10, 10))
>
> In [4]: a = [b, b, b]
>
> In [5]: np.all(np.vstack(a) == np.concatenate([a_[None] for a_ in a]))
> Out[5]: False
>

Hmm, yeah, wouldn't work without reshaping.

np.r_[a]

works, but isn't going to win you any speed contests.

Skipper
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to