Segmentation.translate_segment#

Segmentation.translate_segment(from_seg, to_seg, reverse=False, drop_from=True)[source]#

Translate one of the segments making up the segmentation.

Parameters:
  • from_seg (str | Segment) – The segment to translate. Must be contained within this segmentation.

  • to_seg (str | Segment) – The segment to translate to. A translation must be defined for these two segments.

  • reverse (bool = False) – Whether to perform this translation in reverse (i.e. from more aggregate to less). This will still be performed without factoring so is only appropriate for intensive properties like growth factors, not extensive properties like travel demand.

  • drop_from (bool = True) – Whether to drop the old segment from the resulting segmentation.

Return type:

tuple[Segmentation, Series]