Fix a bug where evening EMAs where also reclassified as daytime.
parent
294d4a2b49
commit
7a12f68dfe
|
@ -196,7 +196,9 @@ def classify_sessions_by_completion_time(
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
object
|
df_session_counts_time: pd.DataFrame
|
||||||
|
A dataframe of all sessions (grouped by GROUP_SESSIONS_BY) with statuses, the number of items,
|
||||||
|
their time type (with some morning EMAs reclassified) and timestamp of first answer.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
df_session_counts = classify_sessions_by_completion(df_esm_preprocessed)
|
df_session_counts = classify_sessions_by_completion(df_esm_preprocessed)
|
||||||
|
@ -204,8 +206,10 @@ def classify_sessions_by_completion_time(
|
||||||
|
|
||||||
df_session_counts_time = df_session_time.join(df_session_counts)
|
df_session_counts_time = df_session_time.join(df_session_counts)
|
||||||
|
|
||||||
df_session_counts_time.loc[
|
morning_transition_to_daytime = (df_session_counts_time.time == "morning") & (
|
||||||
df_session_counts_time.esm_session_count > MAX_MORNING_LENGTH, "time"
|
df_session_counts_time.esm_session_count > MAX_MORNING_LENGTH
|
||||||
] = "daytime"
|
)
|
||||||
|
|
||||||
|
df_session_counts_time.loc[morning_transition_to_daytime, "time"] = "daytime"
|
||||||
|
|
||||||
return df_session_counts_time
|
return df_session_counts_time
|
||||||
|
|
Loading…
Reference in New Issue