followup: vertical slices from a matrix in a dictionary?...

Alex Martelli aleaxit at yahoo.com
Thu Apr 26 07:40:13 EDT 2001


"John J. Lee" <phrxy at csv.warwick.ac.uk> wrote in message
news:Pine.SOL.4.30.0104260356100.6238-100000 at mimosa.csv.warwick.ac.uk...
> On Wed, 25 Apr 2001, John J. Lee wrote:
> [...]
> > z = apply(map, seq)
> [...]
>
> should be z = apply(map, (None, seq)) of course.  In fact, why didn't I
> say map(None, seq), anyway??  I have no idea.  :)

Maybe because seq was a *sequence of sequences* in the original
discussion?  In this case, you want to say

    z = map(None, * seq)

or

    z = apply(map, (None,)+tuple(seq))

(I think the * form is simpler, but you may need the apply in
older Python versions, such as 1.5.2).


Alex






More information about the Python-list mailing list