0

i have the following question: Let us assume we have the following list:

list={1.1,1.2,1.0,2.1,2.2,2,0,3.1,3.0,3.2}

I need a function that always takes three values of this list and put the Mean of these three values into a new list so I want to end with:

list2={1.1,2.1,3.1}

How can i do this easily?

Thank you in advance

Edit: Thank you very much

kglr
  • 394,356
  • 18
  • 477
  • 896
Alexander
  • 109
  • 3

1 Answers1

3
Mean/@Partition[list,3]

This partitions the list into a list of lists with three elements each, and then finds the mean of each list and stores the results in a list. This will only work for lists of length 3, 6, etc.

In the example you've given, there's a stray $0$ which I think you may have missed.

Myridium
  • 1,089
  • 5
  • 15