pm4py.filtering.filter_case_size(log: Union[EventLog, DataFrame], min_size: int, max_size: int, case_id_key: str = 'case:concept:name') Union[EventLog, DataFrame][source]#

Filters the event log, keeping the cases having a length (number of events) included between min_size and max_size

  • log – event log / Pandas dataframe

  • min_size (int) – minimum allowed number of events

  • max_size (int) – maximum allowed number of events

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

Return type:

Union[EventLog, pd.DataFrame]

import pm4py

filtered_dataframe = pm4py.filter_case_size(dataframe, 5, 10, case_id_key='case:concept:name')