DVector.aggregate#

DVector.aggregate(segs, _bypass_validation=False)[source]#

Aggregate DVector to new segmentation.

New Segmentation must be a subset of the current segmentation. Currently this method is essentially a pandas ‘groupby.sum()’, but other methods could be called if needed (e.g. mean())

This method ignores ‘subsets’ in segs, if segs is provided as a Segmentation rather than a list of strings. Subsets must be accounted for separately.

Parameters:
  • segs (Segments to aggregate to. Must be a subset of self.segmentation.naming_order,)

  • preserved. (naming order will be)

  • _bypass_validation (bool)