pm4py.filtering.filter_end_activities(log: Union[EventLog, DataFrame], activities: Union[Set[str], List[str]], retain: bool = True, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') Union[EventLog, DataFrame][source]#

Filter cases having an end activity in the provided list

  • log – event log / Pandas dataframe

  • activities – collection of end activities

  • retain (bool) – if True, we retain the traces containing the given end activities, if false, we drop the traces

  • activity_key (str) – attribute to be used for the activity

  • timestamp_key (str) – attribute to be used for the timestamp

  • case_id_key (str) – attribute to be used as case identifier

Return type:

Union[EventLog, pd.DataFrame]

import pm4py

filtered_dataframe = pm4py.filter_end_activities(dataframe, ['Act. Z'], activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp')