Dataset.aggregate(x=None, drop_empty=True, name='{name}', count='n', drop_bad=False, drop=(), equal_count=False, never_drop=())

Return a Dataset with one case for each cell in x.

  • x (None | str | categorial) – Model defining cells to which to reduce cases. By default (None) the Dataset is reduced to a single case.

  • drop_empty (bool) – Drops empty cells in x from the Dataset. This is currently the only option.

  • name (str) – Name of the new Dataset.

  • count (None | str) – Add a variable with this name to the new Dataset, containing the number of cases in each cell in x.

  • drop_bad (bool) – Drop bad items: silently drop any items for which compression raises an error. This concerns primarily factors with non-unique values for cells in x (if drop_bad is False, an error is raised when such a Factor is encountered)

  • drop (sequence of str) – Additional data-objects to drop.

  • equal_count (bool) – Make sure the same number of rows go into each average. First, the cell with the smallest number of rows is determined. Then, for each cell, rows beyond that number are dropped.

  • never_drop (sequence of str) – If the drop_bad=True setting would lead to dropping a variable whose name is in never_drop, raise an error instead.


Handle mne Epoch objects by creating a list with an mne Evoked object for each cell.