<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19019"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT color=#000080 face="Gill Sans MT">I want to sort two sequences with
different data types but both with an equal number of elements eg.</FONT></DIV>
<DIV><FONT color=#000080 face="Gill Sans MT"></FONT> </DIV>
<DIV><FONT color=#000080 face="Gill Sans MT">f = [0.21, 0.68, 0.44, ...,
0.23]</FONT></DIV>
<DIV><FONT color=#000080 face="Gill Sans MT">i = [6, 18, 3, ...,
45]</FONT></DIV>
<DIV><FONT color=#000080 face="Gill Sans MT"></FONT> </DIV>
<DIV><FONT color=#000080 face="Gill Sans MT">The obvious solution is to use zip
ie. </FONT><FONT color=#000080 face="Gill Sans MT">pairs = zip(f,i) followed by
</FONT><FONT color=#000080 face="Gill Sans MT">pairs.sort(). This is fine
but my sequences contain 10,000+ elements and the sort is performed thousands of
times. Is there a faster solution?</FONT></DIV>
<DIV><FONT color=#000080 face="Gill Sans MT"></FONT> </DIV>
<DIV><FONT color=#000080 face="Gill Sans MT">Dinesh</FONT></DIV>
<DIV><FONT color=#000080 face="Gill Sans MT"></FONT> </DIV>
<DIV><FONT color=#000080 face="Gill Sans MT"></FONT> </DIV></BODY></HTML>