Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread Steven Bethard
Steven Bethard wrote: See my other post in this thread. seq.sort() is not stable; Hmmm... That didn't come out right. list.sort *is* stable. It's just that if you want to sort only by the first element of each tuple in a list, then list.sort won't produce results that are stable under this c

Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread Steven Bethard
F. Petitjean wrote: Le Wed, 13 Apr 2005 01:13:40 -0600, Steven Bethard a écrit : praba kar wrote: list = [[1234,'name1'],[2234,'name2'],[0432,'name3']] I want to sort only numeric value having array field. How I need to do for that. In Python 2.4: py> import operator py> seq = [(1234,'name1'),(223

Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread Steven Bethard
vincent wehren wrote: "praba kar" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Dear All, | |I have doubt regarding sorting. I have a list | that list have another list (eg) | | list = [[1234,'name1'],[2234,'name2'],[0432,'name3']] -> Be careful, 0432 is octal notation f

Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread F. Petitjean
Le Wed, 13 Apr 2005 01:13:40 -0600, Steven Bethard a écrit : > praba kar wrote: >> list = [[1234,'name1'],[2234,'name2'],[0432,'name3']] >> >> I want to sort only numeric value having array field. >> How I need to do for that. > > In Python 2.4: > > py> import operator > py> seq = [(1234,'name1

Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread Steven Bethard
praba kar wrote: I have doubt regarding sorting. I have a list that list have another list (eg) list = [[1234,'name1'],[2234,'name2'],[0432,'name3']] I want to sort only numeric value having array field. How I need to do for that. In Python 2.4: py> import operator py> seq = [(1234,'name1'),(2

Re: Doubt regarding sorting of a list specific field

2005-04-12 Thread vincent wehren
"praba kar" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Dear All, | |I have doubt regarding sorting. I have a list | that list have another list (eg) | | list = [[1234,'name1'],[2234,'name2'],[0432,'name3']] -> Be careful, 0432 is octal notation for 282. | | I want to