ee.Reducer.group
Groups reducer records by the value of a given input and reduces each group with the given reducer.
Usage | Returns |
---|
Reducer.group(groupField, groupName) | Reducer |
Argument | Type | Details |
---|
this: reducer | Reducer | The reducer to apply to each group, without the group field. |
groupField | Integer, default: 0 | The field that contains record groups. |
groupName | String, default: "group" | The dictionary key that contains the group. Defaults to 'group'. |
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 2024-09-19 UTC.
[null,null,["Last updated 2024-09-19 UTC."],[[["Groups records based on a specified field, creating separate groups for each unique value in that field."],["Applies a given reducer function to each group of records, effectively reducing each group to a single result."],["Assigns the original reducer to process individual records within each group, excluding the grouping field itself."],["Organizes the grouped data within a dictionary-like structure, using 'group' as the default key to access the grouped records."]]],["The `Reducer.group` function groups records based on a specified `groupField` (defaulting to field 0). It then applies a provided `reducer` to each group, excluding the grouping field. The result of the reducer on each group is stored under a `groupName` key (defaulting to \"group\"). The function itself returns a `Reducer` object. The `groupField` type can be an Integer.\n"]]