pm4py.utils.sample_events(log: Union[EventStream, OCEL], num_events: int) Union[EventStream, OCEL, DataFrame][source]#

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

  • log – Event stream / OCEL / Pandas dataframes

  • num_events (int) – Number of events to sample

  • case_id_key – attribute to be used as case identifier

Return type:

Union[EventStream, OCEL, pd.DataFrame]

import pm4py

sampled_dataframe = pm4py.sample_events(dataframe, 100)