pynapple.TsGroup.groupby#

TsGroup.groupby(*args, **kwargs)#

Group pynapple object by metadata name(s).

Parameters:
  • by (str or list of str) – Metadata name(s) to group by.

  • get_group (dictionary key, optional) – Name of the group to return.

Returns:

Dictionary of object indices (dictionary values) corresponding to each group (dictionary keys), or pynapple object corresponding to ‘get_group’ if it has been supplied.

Return type:

dict or pynapple object

Raises:

ValueError – If metadata name does not exist.