.. _`Group List`: .. _`org.sysess.sympathy.list.grouplist`: Group List `````````` .. image:: partition_list.svg :width: 48 Group a list using a configured item-based key function. Documentation ::::::::::::: This node takes a key function from the configuration and uses it to decide how to group the items in the input list. The key function is applied once for each input element in the list. All elements for which the key function returns the same value will end up in the same group. Examples with port type == [table] and item type == table: Put all tables with the same number of rows in the same group:: lambda item: item.number_of_rows() Put empty tables in one group and nonempty tables in another group:: lambda item: item.is_empty() The name of the argument is not important. See https://docs.python.org/3/tutorial/controlflow.html#lambda-expressions for a description of lambda functions. Have a look at the :ref:`Data type APIs` to see what methods and attributes are available on the data type that you are working with. Definition :::::::::: Input ports ........... **list** [] List of items Output ports ............ **lists** [[]] Grouped items Configuration ............. **Key function** (predicate) Function, called for each item in `list` to determine its output group. Should return group keys. Related nodes ............. * :ref:`org.sysess.sympathy.list.partitionlistpredicate` Examples ........ * :download:`Predicates.syx ` Implementation .............. .. automodule:: node_filter_list :noindex: .. class:: GroupList :noindex: