Re: Sorting of Data Lists
- To: mathgroup@smc.vnet.net
- Subject: [mg11041] Re: [mg11011] Sorting of Data Lists
- From: BobHanlon@aol.com
- Date: Wed, 18 Feb 1998 20:31:40 -0500
A cleaner and slightly faster approach than my first reply:
Min /@ Transpose[{a, b}]
Bob Hanlon
FORWARDED MESSAGE:
a = Table[Random[], {10}]
{0.686343, 0.510246, 0.674491, 0.518116, 0.535909, 0.170308, 0.572901,
0.169033, 0.375999, 0.104331}
b = Table[Random[], {10}]
{0.0372163, 0.162369, 0.315898, 0.444942, 0.13808, 0.675542, 0.479727,
0.710194, 0.216237, 0.692723}
Transpose[{a, b}] /. {x_, y_} -> Min[x, y]
{0.0372163, 0.162369, 0.315898, 0.444942, 0.13808, 0.170308, 0.479727,
0.169033, 0.216237, 0.104331}
Bob Hanlon