11:16:30 +1100
From: Steven D'Aprano
To: tutor@python.org
Subject: Re: [Tutor] Sorting multiple sequences
Message-ID: <4d7abb5e.9080...@pearwood.info>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Dinesh B Vadhia wrote:
> I want to sort two sequences with different
Dinesh B Vadhia wrote:
I want to sort two sequences with different data types but both with an equal
number of elements eg.
f = [0.21, 0.68, 0.44, ..., 0.23]
i = [6, 18, 3, ..., 45]
The obvious solution is to use zip ie. pairs = zip(f,i) followed by pairs.sort(). This is fine
It doesn't so
On 3/11/2011 3:39 PM Dinesh B Vadhia said...
I want to sort two sequences with different data types but both with an
equal number of elements eg.
f = [0.21, 0.68, 0.44, ..., 0.23]
i = [6, 18, 3, ..., 45]
The obvious solution is to use zip ie. pairs = zip(f,i) followed by
pairs.sort(). This is fin
I want to sort two sequences with different data types but both with an equal
number of elements eg.
f = [0.21, 0.68, 0.44, ..., 0.23]
i = [6, 18, 3, ..., 45]
The obvious solution is to use zip ie. pairs = zip(f,i) followed by
pairs.sort(). This is fine but my sequences contain 10,000+ element