pm4py.algo.filtering.pandas.suffixes.suffix_filter module#

class pm4py.algo.filtering.pandas.suffixes.suffix_filter.Parameters(*values)[source]#

Bases: Enum

CASE_ID_KEY = 'pm4py:param:case_id_key'#
ACTIVITY_KEY = 'pm4py:param:activity_key'#
INDEX_KEY = 'index_key'#
INDEX_IN_TRACE_KEY = 'index_in_trace_key'#
USE_EXTREMES_TIMESTAMP = 'use_extremes_timestamp'#
TEMP_COLUMN = 'temp_column'#
FIRST_OR_LAST = 'first_or_last'#
STRICT = 'strict'#
pm4py.algo.filtering.pandas.suffixes.suffix_filter.apply(df: DataFrame, activity: str, parameters: Dict[Any, Any] | None = None)[source]#

Filter all the suffixes to a given activity (first or last occurrence of the activity in the case).

Parameters:
  • df – Dataframe

  • parameters – Parameters of the algorithm: - Parameters.CASE_ID_KEY => the case identifier column. - Parameters.ACTIVITY_KEY => the activity column. - Parameters.INDEX_IN_TRACE_KEY => attribute that should act as container of the index of the event inside

    the case.

    • Parameters.TEMP_COLUMN => temporary column which is used for internal purposes.

    • Parameters.FIRST_OR_LAST => filter on the first or last occurrence of an activity in the dataframe.

    • Parameters.STRICT => applies the filter in a strict (<) or lean (<=) way (boolean).

Returns:

Dataframe filtered keeping the prefixes to a given activity (first or last occurrence of the activity in the case).

Return type:

df