AddSegment#

Data processor#

class retentioneering.data_processors_lib.add_segment.AddSegment(params)[source]#

Add segment synthetic events to eventstream.

Parameters:
segmentstr, Callable, or pandas.Series

Segment to add to eventstream.

  • If str, it should be a column name in eventstream.

  • If Callable, it should be a function that takes eventstream DataFrame and returns a list-like object specifing segment values for each event.

  • If pandas.Series, it should has index as path ids and values as segment values.

namestr, optional

Name of the segment.

Returns:
EventstreamType

Eventstream with added segment.

Eventstream#

AddSegmentHelperMixin.add_segment(segment, name=None)[source]#

Add segment synthetic events to eventstream.

Parameters:
segmentstr, Callable, or pandas.Series

Segment to add to eventstream.

  • If str, it should be a column name in eventstream.

  • If Callable, it should be a function that takes eventstream DataFrame and returns a list-like object specifing segment values for each event.

  • If pandas.Series, it should has index as path ids and values as segment values.

namestr, optional

Name of the segment.

Returns:
EventstreamType

Eventstream with added segment.