pm4py.stats.get_case_arrival_average#

pm4py.stats.get_case_arrival_average(log: EventLog | DataFrame, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') float[source]#

Calculates the average time difference between the start times of two consecutive cases.

This metric is based on the definition: Cycle time = Average time between completion of units.

Example: In a manufacturing facility producing 100 units in a 40-hour week, the average throughput rate is 1 unit per 0.4 hours (24 minutes per unit). Therefore, the cycle time is 24 minutes on average.

Return type:

float

Parameters:
  • log – Event log (EventLog or pandas DataFrame).

  • activity_key (str) – Attribute to be used for the activity.

  • timestamp_key (str) – Attribute to be used for the timestamp.

  • case_id_key (str) – Attribute to be used as the case identifier.

Returns:

The average case arrival time in the same units as the timestamp.

import pm4py

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