unzip array of arrays?
robert.kern at gmail.com
Thu Jan 22 23:57:02 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?]
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Python-list