pm4py.filtering.filter_start_activities#

pm4py.filtering.filter_start_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]#

Filters cases that have a start activity in the provided list.

Parameters:
  • log – Event log or Pandas DataFrame.

  • activities – Collection of start activities.

  • retain (bool) – If True, retains the traces containing the given start activities; if False, drops 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.

Returns:

Filtered event log or Pandas DataFrame.

import pm4py

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