pm4py.filtering.filter_end_activities#
- pm4py.filtering.filter_end_activities(log: EventLog | DataFrame, activities: Set[str] | List[str], retain: bool = True, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') EventLog | DataFrame [source]#
Filter cases having an end activity in the provided list
- Parameters:
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 tracesactivity_key (
str
) – attribute to be used for the activitytimestamp_key (
str
) – attribute to be used for the timestampcase_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')