ee.Reducer.forEachElement
Separately reduces each position in array inputs of equal shape, producing an array output of the same shape.
For example, with the 'sum' reducer applied to 5 arrays with shape 2x2, the output will be a 2x2 array, where each position is the sum of the 5 values at that position.
Usage | Returns |
---|
Reducer.forEachElement() | Reducer |
Argument | Type | Details |
---|
this: reducer | Reducer | The reducer to apply to each array element. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["Applies a reducer function to corresponding elements across multiple arrays of the same shape."],["Outputs a single array mirroring the input shape, with each element representing the reduced value of corresponding input elements."],["Offers flexibility through the `forEachElement` method to specify the reducer function."],["Illustrated with an example using the 'sum' reducer to aggregate values across five 2x2 arrays into a resultant 2x2 array."]]],[]]