pm4py.convert.convert_to_event_log#
- pm4py.convert.convert_to_event_log(obj: DataFrame | EventStream, case_id_key: str = 'case:concept:name', **kwargs) EventLog [source]#
Converts a DataFrame/EventStream object to an event log object
- Parameters:
obj – DataFrame or EventStream object
case_id_key (
str
) – attribute to be used as case identifier
- Return type:
EventLog
import pandas as pd import pm4py dataframe = pm4py.read_csv("tests/input_data/running-example.csv") dataframe = pm4py.format_dataframe(dataframe, case_id_column='case:concept:name', activity_column='concept:name', timestamp_column='time:timestamp') log = pm4py.convert_to_event_log(dataframe)