pm4py.utils.sample_events#
- pm4py.utils.sample_events(log: EventStream | OCEL, num_events: int) EventStream | OCEL | DataFrame [source]#
(Random) Sample a given number of events from the event log.
- Parameters:
log – Event stream / OCEL / Pandas dataframes
num_events (
int
) – Number of events to samplecase_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)