Use refactored methods.
parent
2aa5c5cb07
commit
ca85131ed2
|
@ -26,10 +26,11 @@ from features.esm import (
|
||||||
get_esm_data,
|
get_esm_data,
|
||||||
increment_answers,
|
increment_answers,
|
||||||
preprocess_esm,
|
preprocess_esm,
|
||||||
|
reassign_question_ids,
|
||||||
)
|
)
|
||||||
from features.esm_COPE import reassign_question_ids
|
from features.esm_COPE import DICT_COPE_QUESTION_IDS
|
||||||
from features.esm_JCQ import reverse_jcq_demand_control_scoring
|
from features.esm_JCQ import reverse_jcq_demand_control_scoring
|
||||||
from features.esm_SAM import extract_stressful_events
|
from features.esm_SAM import DICT_SAM_QUESTION_IDS, extract_stressful_events
|
||||||
|
|
||||||
# import os
|
# import os
|
||||||
# import sys
|
# import sys
|
||||||
|
@ -294,7 +295,9 @@ df_esm_SAM_clean.esm_status.value_counts()
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
if export_data:
|
if export_data:
|
||||||
df_esm_SAM_for_export = df_esm_SAM_clean[
|
df_esm_SAM_fixed = reassign_question_ids(df_esm_SAM_clean, DICT_SAM_QUESTION_IDS)
|
||||||
|
df_esm_SAM_fixed = increment_answers(df_esm_SAM_fixed)
|
||||||
|
df_esm_SAM_for_export = df_esm_SAM_fixed[
|
||||||
[
|
[
|
||||||
"participant_id",
|
"participant_id",
|
||||||
"username",
|
"username",
|
||||||
|
@ -314,7 +317,6 @@ if export_data:
|
||||||
"esm_user_answer_numeric",
|
"esm_user_answer_numeric",
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
df_esm_SAM_for_export = increment_answers(df_esm_SAM_for_export)
|
|
||||||
df_esm_SAM_for_export.sort_values(
|
df_esm_SAM_for_export.sort_values(
|
||||||
by=["participant_id", "device_id", "_id"], ignore_index=True, inplace=True
|
by=["participant_id", "device_id", "_id"], ignore_index=True, inplace=True
|
||||||
)
|
)
|
||||||
|
@ -421,7 +423,7 @@ df_esm_COPE = df_esm_preprocessed[
|
||||||
# %%
|
# %%
|
||||||
df_esm_COPE_clean = clean_up_esm(df_esm_COPE)
|
df_esm_COPE_clean = clean_up_esm(df_esm_COPE)
|
||||||
df_esm_COPE_clean = increment_answers(df_esm_COPE_clean)
|
df_esm_COPE_clean = increment_answers(df_esm_COPE_clean)
|
||||||
df_esm_COPE_fixed = reassign_question_ids(df_esm_COPE_clean)
|
df_esm_COPE_fixed = reassign_question_ids(df_esm_COPE_clean, DICT_COPE_QUESTION_IDS)
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
if export_data:
|
if export_data:
|
||||||
|
|
Loading…
Reference in New Issue