I have some data this
dataABC = {
{"a", 1, 2, 3},
{"b", 1, 3, 5},
{"c", 1, 2, 1},
{"a", 1, 2, 3},
{"a", 1, 1, 1},
{"c", 1, 1, 1},
{"b", 2, 2, 2}
};
As you can see," a "," b" and "c" are followed by a series of numbers that represent their values.
For example,if {"a",1,2,3}
There are a lot of sublists like {"a",1,2,3} in the above data.
So what I want to do now is take the average of a, b, c with respect to value1, value2, value3,My English is not very good, and the following picture can better illustrate what I mean.
To find their average,I'm going to sort the data so that the "a", the "b", the "c" are all together,like this
dataABC1 = dataABC // Sort
Now what I'm going to do is I'm going to average them, and I don't know how to do that, right,I have tried using functions such as Select, Cases, etc. without success. What should I do?



GroupBy[dataABC, First -> Rest, Mean] // KeyValueMap[List]also works : ) – AsukaMinato Jan 07 '23 at 16:35