This question already has an answer here:

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


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:


How can i do this easily?

Thank you in advance

Edit: Thank you very much


marked as duplicate by Mr.Wizard May 30 '14 at 9:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ If you've received a satisfactory answer to your question, you don't have to edit your post to say thank you, you should accept the answer instead. $\endgroup$ – Rahul May 30 '14 at 8:42
  • 1
    $\begingroup$ And you should upvote any answer you like, too. $\endgroup$ – Yves Klett May 30 '14 at 8:45
  • 1
    $\begingroup$ I changed the marked duplicate to one that truly is a duplicate. Please also see the questions linked in my answer there. $\endgroup$ – Mr.Wizard May 30 '14 at 9:30

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.


Not the answer you're looking for? Browse other questions tagged or ask your own question.