[Numpy-discussion] List of arrays
Francesc Alted
faltet at pytables.org
Tue May 12 03:55:38 EDT 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