pm4py.utils.sample_cases(log: Union[EventLog, DataFrame], num_cases: int, case_id_key: str = 'case:concept:name') Union[EventLog, DataFrame][source]#

(Random) Sample a given number of cases from the event log.

  • log – Event log / Pandas dataframe

  • num_cases (int) – Number of cases to sample

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

Return type:

Union[EventLog, pd.DataFrame]

import pm4py

sampled_dataframe = pm4py.sample_cases(dataframe, 10, case_id_key='case:concept:name')