unzip array of arrays?

Grant Edwards invalid at invalid
Thu Jan 22 23:12:38 CET 2009

On 2009-01-22, Tobiah <toby at tobiah.org> wrote:
> Although it's trivial to program, I wondered whether
> there was a builtin or particularly concise way to
> express this idea:
>> a = [(1, 2), (3, 4), (5, 6)]
>> field[a, 2]
> [2, 4, 6]
> where field() is some made up function.

The above example is a great application for numpy's array


Here's an example showing how you extract a column using
indexing operations:
[I assume numpy is still the numerical/array package du jour?]
Grant Edwards                   grante             Yow! WHO sees a BEACH BUNNY
                                  at               sobbing on a SHAG RUG?!

More information about the Python-list mailing list