pm4py.filtering.filter_event_attribute_values#

pm4py.filtering.filter_event_attribute_values(log: EventLog | DataFrame, attribute_key: str, values: Set[str] | List[str], level: str = 'case', retain: bool = True, case_id_key: str = 'case:concept:name') EventLog | DataFrame[source]#

Filters a log object based on the values of a specified event attribute.

Parameters:
  • log – Event log or Pandas DataFrame.

  • attribute_key (str) – Attribute to filter.

  • values – Admitted or forbidden values.

  • level (str) – Specifies how the filter should be applied (‘case’ filters the cases where at least one occurrence happens; ‘event’ filters the events, potentially trimming the cases).

  • retain (bool) – Specifies if the values should be kept or removed.

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

Returns:

Filtered event log or Pandas DataFrame.

import pm4py

filtered_dataframe = pm4py.filter_event_attribute_values(
    dataframe,
    'concept:name',
    ['Act. A', 'Act. Z'],
    case_id_key='case:concept:name'
)