Export SAM data.
parent
51201c2bc9
commit
5c0e2e2621
|
@ -12,6 +12,7 @@ __pycache__/
|
||||||
/data/*input*.csv
|
/data/*input*.csv
|
||||||
/data/daily*
|
/data/daily*
|
||||||
/data/intradaily*
|
/data/intradaily*
|
||||||
|
/data/raw
|
||||||
/data/stressfulness_event*
|
/data/stressfulness_event*
|
||||||
/data/30min*
|
/data/30min*
|
||||||
/presentation/*scores.csv
|
/presentation/*scores.csv
|
||||||
|
|
|
@ -33,6 +33,7 @@ from features.esm_SAM import extract_stressful_events
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
save_figs = False
|
save_figs = False
|
||||||
|
export_data = True
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
participants_inactive_usernames = participants.query_db.get_usernames(
|
participants_inactive_usernames = participants.query_db.get_usernames(
|
||||||
|
@ -278,6 +279,41 @@ df_esm_SAM_threat_challenge_summary_participant.groupby("event subscale").descri
|
||||||
"std"
|
"std"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# %%
|
||||||
|
df_esm_SAM_clean.columns
|
||||||
|
|
||||||
|
# %%
|
||||||
|
df_esm_SAM_clean.esm_status.value_counts()
|
||||||
|
|
||||||
|
# %%
|
||||||
|
if export_data:
|
||||||
|
df_esm_SAM_for_export = df_esm_SAM_clean[
|
||||||
|
[
|
||||||
|
"participant_id",
|
||||||
|
"username",
|
||||||
|
"device_id",
|
||||||
|
"_id",
|
||||||
|
"esm_trigger",
|
||||||
|
"esm_session",
|
||||||
|
"esm_notification_id",
|
||||||
|
"question_id",
|
||||||
|
"questionnaire_id",
|
||||||
|
"double_esm_user_answer_timestamp",
|
||||||
|
"datetime_lj",
|
||||||
|
"date_lj",
|
||||||
|
"time",
|
||||||
|
"esm_user_answer",
|
||||||
|
"esm_user_answer_numeric",
|
||||||
|
]
|
||||||
|
]
|
||||||
|
df_esm_SAM_for_export.sort_values(
|
||||||
|
by=["participant_id", "datetime_lj", "_id"], ignore_index=True, inplace=True
|
||||||
|
)
|
||||||
|
print(df_esm_SAM_for_export.head())
|
||||||
|
df_esm_SAM_for_export.to_csv(
|
||||||
|
"../data/raw/df_esm_SAM_daily_threat_challenge.csv", index=False
|
||||||
|
)
|
||||||
|
|
||||||
# %% [markdown]
|
# %% [markdown]
|
||||||
# ## Stressfulness of period
|
# ## Stressfulness of period
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue