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]#
Filter a log object on the values of some event attribute
- Parameters:
log – event log / Pandas dataframe
attribute_key (
str
) – attribute to filtervalues – admitted (or forbidden) values
level (
str
) – specifies how the filter should be applied (‘case’ filters the cases where at least one occurrence happens, ‘event’ filter the events eventually trimming the cases)retain (
bool
) – specifies if the values should be kept or removedcase_id_key (
str
) – attribute to be used as case identifier
- Return type:
Union[EventLog, pd.DataFrame]
import pm4py filtered_dataframe = pm4py.filter_event_attribute_values(dataframe, 'concept:name', ['Act. A', 'Act. Z'], case_id_key='case:concept:name')