pm4py.analysis.insert_case_service_waiting_time#

pm4py.analysis.insert_case_service_waiting_time(log: EventLog | DataFrame, service_time_column: str = '@@service_time', sojourn_time_column: str = '@@sojourn_time', waiting_time_column: str = '@@waiting_time', activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name', start_timestamp_key: str = 'time:timestamp') DataFrame[source]#

Inserts service time, waiting time, and sojourn time information for each case into a Pandas DataFrame.

Parameters:
  • log – The event log or Pandas DataFrame to modify.

  • service_time_column (str) – The name of the column to store service times.

  • sojourn_time_column (str) – The name of the column to store sojourn times.

  • waiting_time_column (str) – The name of the column to store waiting times.

  • activity_key (str) – The attribute key used for activities.

  • timestamp_key (str) – The attribute key used for timestamps.

  • case_id_key (str) – The attribute key used to identify cases.

  • start_timestamp_key (str) – The attribute key used for the start timestamp of cases.

Returns:

A Pandas DataFrame with the inserted service, waiting, and sojourn time columns.

Return type:

pd.DataFrame

import pm4py

dataframe = pm4py.insert_case_service_waiting_time(
    dataframe,
    activity_key='concept:name',
    timestamp_key='time:timestamp',
    case_id_key='case:concept:name',
    start_timestamp_key='time:timestamp'
)