[Numpy-discussion] List of arrays

Francesc Alted faltet@pytables....
Tue May 12 02:55:38 CDT 2009


On Monday 11 May 2009 23:52:29 Christopher Barker wrote:
> Wei Su wrote:
> > The codes do not work. Guess you forgot something there.
>
> l wasn't defined:
>
> In [16]: a = np.arange(10)
>
> In [17]: b = np.arange(5)
>
> In [20]: l = [a,b]
>
> In [21]: l
> Out[21]: [array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), array([0, 1, 2, 3, 4])]
>
> In [22]: np.concatenate(l)
> Out[22]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4])

Oops.  That's it.

Thanks Chris!

-- 
Francesc Alted


More information about the Numpy-discussion mailing list