On Aug 4, 7:29 pm, [EMAIL PROTECTED] (Alex Martelli) wrote:
> Cousin Stanley <[EMAIL PROTECTED]> wrote:
>
>...
>
> > for i , item in reversed( enumerate( sorted( single_list ) ) ) :
>...
> > TypeError: argument to reversed() must be a sequence
>
> Oops, right. Well then,
>
> aux_
> Cousin Stanley <[EMAIL PROTECTED]> wrote:
>...
>> for i , item in reversed( enumerate( sorted( single_list ) ) ) :
>...
>> TypeError: argument to reversed() must be a sequence
>
> Oops, right. Well then,
>
> aux_seq = list(enumerate(sorted(single_list)))
> for i, item in r
Cousin Stanley <[EMAIL PROTECTED]> wrote:
...
> for i , item in reversed( enumerate( sorted( single_list ) ) ) :
...
> TypeError: argument to reversed() must be a sequence
Oops, right. Well then,
aux_seq = list(enumerate(sorted(single_list)))
for i, item in reversed(aux_seq):
>
> "beginner"'s advice to use a dictionary is also good
> and may turn out to be faster, just because dicts are
> SO fast in Python -- but you need to try and measure
> both alternatives.
>
> One way to use a dict ( warning, untested code ) :
def rank_list( single_list ) :
d =
On Aug 3, 5:53 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-08-03, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > A naive approach to rank ordering (handling ties as well) of nested
> > lists may be accomplished via:
>
> >def rankLists(nestedList):
> > def rankList(single
On Aug 3, 9:20 am, [EMAIL PROTECTED] wrote:
> On Aug 2, 10:20 pm, "[EMAIL PROTECTED]"
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > A naive approach to rank ordering (handling ties as well) of nested
> > lists may be accomplished via:
>
> >def rankLists(nestedList):
> > def rankList(singleList):
On Aug 3, 8:38 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > A naive approach to rank ordering (handling ties as well) of nested
> > lists may be accomplished via:
>
> >def rankLists(nestedList):
> > def rankList(singleList):
> >
On Aug 2, 10:20 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> A naive approach to rank ordering (handling ties as well) of nested
> lists may be accomplished via:
>
>def rankLists(nestedList):
> def rankList(singleList):
> sortedList = list(singleList)
> sortedL
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> A naive approach to rank ordering (handling ties as well) of nested
> lists may be accomplished via:
>
>def rankLists(nestedList):
> def rankList(singleList):
> sortedList = list(singleList)
> sortedList.sort()
>
On 2007-08-03, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> A naive approach to rank ordering (handling ties as well) of nested
> lists may be accomplished via:
>
>def rankLists(nestedList):
> def rankList(singleList):
> sortedList = list(singleList)
> sortedList.sor
On Aug 2, 8:20 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> A naive approach to rank ordering (handling ties as well) of nested
> lists may be accomplished via:
>
>def rankLists(nestedList):
> def rankList(singleList):
> sortedList = list(singleList)
> sortedLi
A naive approach to rank ordering (handling ties as well) of nested
lists may be accomplished via:
def rankLists(nestedList):
def rankList(singleList):
sortedList = list(singleList)
sortedList.sort()
return map(sortedList.index, singleList)
return map(r
12 matches
Mail list logo