I want to calculate the column mean of the following set of data as the result of 1 row and 7 columns.

Which functions should I use in Google Earth Engine or should I write an extra function?

var data=[['1','2','3','4','5','6','7'],

1 Answer 1


One way is:

var data=ee.Array([[1,2,3,4,5,6,7], [8,9,10,11,12,13,14],

var data2 = data.transpose().toList();

var mean = data2.map(function(lis) {
  return ee.List(lis).reduce(ee.Reducer.mean());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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