Getting sorting order

2008-06-30 Thread leodp
ted() do not return the order of sorting. Maybe I have to write some more code. Ciao, leodp -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting sorting order

2008-06-30 Thread leodp
infos on how the list was sorted slave1.sort(key=_maybe_something_here_referring_to_master_) slave2.sort(key=_maybe_something_here_referring_to_master_) Then I should get: master=[1,2,3,4] slave1=['d','a','b','c'] slave2=[1,4,3,2] Hope it is more clear now. Thanks, leodp -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting sorting order

2008-06-30 Thread leodp
> >>> master_index.sort(key=master.__getitem__) that was it! Thanks Peter, leodp -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting sorting order

2008-06-30 Thread leodp
> >>> x=zip(master,slave1,slave2) > >>> x.sort() > >>> master,slave1,slave2=zip(*x) > --Mark So nice is Python. Leo -- http://mail.python.org/mailman/listinfo/python-list