Victor Bouffier wrote:
> On Tue, 2006-04-11 at 22:17 -0400, Kent Johnson wrote:
>> Victor Bouffier wrote:
>>
>>> If the second element in each array passed as x is of variable length
>>> (that is, it has a different element count than three, in this case),
>>> the program needs to extend the list i
On Tue, 2006-04-11 at 22:17 -0400, Kent Johnson wrote:
> Victor Bouffier wrote:
>
> > If the second element in each array passed as x is of variable length
> > (that is, it has a different element count than three, in this case),
> > the program needs to extend the list instead. Without list
> > c
Victor Bouffier wrote:
> If the second element in each array passed as x is of variable length
> (that is, it has a different element count than three, in this case),
> the program needs to extend the list instead. Without list
> comprehensions, and the added capability to utilize and sized list a
On Tue, 2006-04-11 at 23:42 +0100, Alan Gauld wrote:
> Hi Victor,
>
> I've gotta say that I much prefer the second version here.
>
> > temporal = []
> > temporal = [ [x[1][1], (x[0], description[x[0]],
> >x[1][0], x[1][1], x[1][2] ) ] for x in elements ]
> > temporal.sort()
> > temporal.rever
Hi Victor,
I've gotta say that I much prefer the second version here.
> temporal = []
> temporal = [ [x[1][1], (x[0], description[x[0]],
>x[1][0], x[1][1], x[1][2] ) ] for x in elements ]
> temporal.sort()
> temporal.reverse() # sort descending
> elements = [ x[1] for x in temporal ]
On 12/04/06, Victor Bouffier <[EMAIL PROTECTED]> wrote:
> elements = [
> (codigo, [ cant, importe, porc]),
> (codigo, [ cant, importe, porc]),
> ...
> ]
>
> And I want to sort descending on 'importe', which is x[1][1] for x in
> elements.
In python 2.4, you could achieve this by saying:
elements.