Efficient way to break up a list into two pieces

marwie marwie at gmx.de
Sun Feb 21 20:08:30 CET 2010


On 21 Feb., 07:38, Carl Banks <pavlovevide... at gmail.com> wrote:
> Numpy arrays can share underlying data like that when you take
> slices.  For instance, this probably works the way you want:
>
> a = numpy.array([1,2,3,4,5,6])
> b = a[:3]
> c = a[3:]
>
> None of the actual data was copied here.

Hmm, that might be worth looking into. Thanks.




More information about the Python-list mailing list