hpcflow.sdk.core.utils.group_by_dict_key_values#
- hpcflow.sdk.core.utils.group_by_dict_key_values(lst: list[dict[T, T2]], key: T) list[list[dict[T, T2]]] #
- hpcflow.sdk.core.utils.group_by_dict_key_values(lst: list[TD], key: str) list[list[TD]]
Group a list of dicts according to specified equivalent key-values.
- Parameters:
- Returns:
grouped
- Return type:
Examples
>>> group_by_dict_key_values([{'a': 1}, {'a': 2}, {'a': 1}], 'a') [[{'a': 1}, {'a': 1}], [{'a': 2}]]