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

John J. Lee phrxy at csv.warwick.ac.uk
Fri Apr 27 23:15:31 EDT 2001


On Thu, 26 Apr 2001, Alex Martelli wrote:

> "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).

Hmm.  Should have actually tried it out, both times, shouldn't I?  Sorry!


John




More information about the Python-list mailing list