On Apr 12, 9:26 pm, Steven D'Aprano
wrote:
> # The obfuscated, fragile way
> map( itemgetter(0), sorted(
> zip(db, range(1, len(db)+1)), key=lambda t: t[1] if t[1] in i else -1
> )[-len(i):] )
I have to hand it to you that this might, in fact, be "the"
obfuscated, fragile way, but I go
On Mon, 12 Apr 2010 13:05:30 -0700, vsoler wrote:
> Hi everyone,
>
> say that 'db' is a list of values
> say 'i' is a list of indexes
> I'd like to get a list where each item is i-th element of db.
>
> For example:
>
> db=[10,20,30,40,50,60,70,80,90] #undefined length
> i=[3,5,7] #undefi
On 12 abr, 22:11, Patrick Maupin wrote:
> On Apr 12, 3:05 pm, vsoler wrote:
>
> > Hi everyone,
>
> > say that 'db' is a list of values
> > say 'i' is a list of indexes
> > I'd like to get a list where each item is i-th element of db.
>
> > For example:
>
> > db=[10,20,30,40,50,60,70,80,90] #
On Mon, Apr 12, 2010 at 1:05 PM, vsoler wrote:
> Hi everyone,
>
> say that 'db' is a list of values
> say 'i' is a list of indexes
> I'd like to get a list where each item is i-th element of db.
>
> For example:
>
> db=[10,20,30,40,50,60,70,80,90] #undefined length
> i=[3,5,7]
On Apr 12, 3:05 pm, vsoler wrote:
> Hi everyone,
>
> say that 'db' is a list of values
> say 'i' is a list of indexes
> I'd like to get a list where each item is i-th element of db.
>
> For example:
>
> db=[10,20,30,40,50,60,70,80,90] #undefined length
> i=[3,5,7]