pm4py.utils.parse_event_log_string#

pm4py.utils.parse_event_log_string(traces: Collection[str], sep: str = ',', activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name', return_legacy_log_object: bool = False) EventLog | DataFrame[source]#

Parse a collection of traces expressed as strings (e.g., [“A,B,C,D”, “A,C,B,D”, “A,D”]) to a log object (Pandas dataframe)

Parameters:
  • traces – Collection of traces expressed as strings

  • sep (str) – Separator used to split the activities of a string trace

  • activity_key (str) – The attribute that should be used as activity

  • timestamp_key (str) – The attribute that should be used as timestamp

  • case_id_key (str) – The attribute that should be used as case identifier

  • return_legacy_log_object (bool) – boolean value enabling returning a log object (default: False)

Return type:

pd.DataFrame

import pm4py

dataframe = pm4py.parse_event_log_string(["A,B,C,D", "A,C,B,D", "A,D"])