Pauses

num_pauses(df, traces=None, threshold=100, computeTraces=True)

Calculate the number of pauses in the DataFrame.

Parameters:
  • df (pd.DataFrame) – DataFrame containing ‘timeStamp’ column.

  • threshold (float) – Time threshold in milliseconds to consider a pause, by default 100 ms.

  • computeTraces (bool) – Whether to compute traces by sessionId, by default True. If False, df is assumed to be already segmented by sessionId.

Returns:

A dictionary containing the number of pauses and the mean pause pere trace. With NUMBER_OF_PAUSES and MEAN_PAUSE_PER_TRACE as keys.

Return type:

dict

pauses_metrics(df, threshold=100, traces=None, per_traces=True)

Calculate pause metrics for the given DataFrame.

Parameters:
  • df (pd.DataFrame) – DataFrame containing ‘timeStamp’ column.

  • threshold (float) – Time threshold in milliseconds to consider a pause, by default 100 ms.

  • traces (dict) – Dictionary with sessionId as keys and list of DataFrames as values.

Returns:

A dictionary with sessionId as keys and a dictionary of pause metrics as values.

Return type:

dict