Union[EventLog, DataFrame], length: int, case_id_key: str = 'case:concept:name') Union[EventLog, DataFrame][source]#

Gets the prefixes of a log of a given length. The returned log object contain the prefixes: - if a trace has lower or identical length, it is included as-is - if a trace has greater length, it is cut

  • log – event log / Pandas dataframe

  • length (int) – length

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

Return type:

Union[EventLog, pd.DataFrame]

import pm4py

trimmed_df = pm4py.get_prefixes_from_log(dataframe, length=5, case_id_key='case:concept:name')