pm4py.analysis.insert_case_arrival_finish_rate#
- pm4py.analysis.insert_case_arrival_finish_rate(log: EventLog | DataFrame, arrival_rate_column: str = '@@arrival_rate', finish_rate_column: str = '@@finish_rate', 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 arrival and finish rate information for each case into a Pandas DataFrame.
The arrival rate is computed as the time difference between the start of the current case and the start of the previous case to start. The finish rate is computed as the time difference between the end of the current case and the end of the next case to finish.
- Parameters:
log – The event log or Pandas DataFrame to modify.
arrival_rate_column (
str
) – The name of the column to store arrival rates.finish_rate_column (
str
) – The name of the column to store finish rates.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 arrival and finish rate columns.
- Return type:
pd.DataFrame
import pm4py dataframe = pm4py.insert_case_arrival_finish_rate( dataframe, activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name', start_timestamp_key='time:timestamp' )