Mathematica 9 is now available
Student Support Forum
Student Support Forum > General > > "Operation on specific cases"

Post Reply:
Email Address:

Please send email when my message is replied to.

Url (optional):
Message: view original message?
Attachment (optional):
Please answer this:3+4 =

Original Message (ID '367986') By yehuda:
It is more than a simple Case or Select (since then you will have to loop according to the values of the first element) 1. Transpose a (Thread also works) so you get a list of pairs, one from the first list and one form the second list 2. GroupBy to group these pairs according to their first element 3. Use Map at level 2 to remove the first element 4 Map the function Mean on the result so you get your results Mean /@ Map[Last, GatherBy[Transpose[a], First], {2}] result is {3,4} as expected HTH yehuda