hello, I typically run into this problem and I'm not always sure of the most 
efficient way to handle it. I often work with multiple arrays of data, say 
arrays a, b, and c, and I want to sort the elements of b and c based on a. for 
example:

a = [3,2,1,4]
b = ['hi', 'my','name', 'is']
c = [5,2,4,2]

I order 'a' from small to large and do the same rearrangement to 'b' and 'c':
a = [1,2,3,4]
 b = ['name', 'my','hi', 'is']
 c = [4,2,5,2]

usually I do some terrible looking for loops and iterate over the whole 
mess.... is there a clean, efficient way to do this, or is there a nice 
function that would reorder the elements of b and c based on the soring of a?

thanks

 
---------------------------------
Don't be flakey. Get Yahoo! Mail for Mobile and 
always stay connected to friends.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to