|
|
@ -60,15 +60,15 @@ if not participant_info.empty: |
|
|
|
0, "startlanguage" |
|
|
|
] |
|
|
|
if ( |
|
|
|
("demand" in requested_features) |
|
|
|
or ("control" in requested_features) |
|
|
|
or ("demand_control_ratio" in requested_features) |
|
|
|
("limesurvey_demand" in requested_features) |
|
|
|
or ("limesurvey_control" in requested_features) |
|
|
|
or ("limesurvey_demand_control_ratio" in requested_features) |
|
|
|
): |
|
|
|
participant_info_t = participant_info.T |
|
|
|
rows_baseline = participant_info_t.index |
|
|
|
|
|
|
|
if ("demand" in requested_features) or ( |
|
|
|
"demand_control_ratio" in requested_features |
|
|
|
if ("limesurvey_demand" in requested_features) or ( |
|
|
|
"limesurvey_demand_control_ratio" in requested_features |
|
|
|
): |
|
|
|
# Find questions about demand, but disregard time (duration of filling in questionnaire) |
|
|
|
rows_demand = rows_baseline.str.startswith( |
|
|
@ -96,12 +96,12 @@ if not participant_info.empty: |
|
|
|
) |
|
|
|
baseline_interim = pd.concat([baseline_interim, limesurvey_demand], axis=0, ignore_index=True) |
|
|
|
if "demand" in requested_features: |
|
|
|
baseline_features.loc[0, "demand"] = limesurvey_demand[ |
|
|
|
baseline_features.loc[0, "limesurvey_demand"] = limesurvey_demand[ |
|
|
|
"score" |
|
|
|
].sum() |
|
|
|
|
|
|
|
if ("control" in requested_features) or ( |
|
|
|
"demand_control_ratio" in requested_features |
|
|
|
if ("limesurvey_control" in requested_features) or ( |
|
|
|
"limesurvey_demand_control_ratio" in requested_features |
|
|
|
): |
|
|
|
# Find questions about control, but disregard time (duration of filling in questionnaire) |
|
|
|
rows_control = rows_baseline.str.startswith( |
|
|
@ -130,12 +130,12 @@ if not participant_info.empty: |
|
|
|
|
|
|
|
baseline_interim = pd.concat([baseline_interim, limesurvey_control], axis=0, ignore_index=True) |
|
|
|
|
|
|
|
if "control" in requested_features: |
|
|
|
baseline_features.loc[0, "control"] = limesurvey_control[ |
|
|
|
if "limesurvey_control" in requested_features: |
|
|
|
baseline_features.loc[0, "limesurvey_control"] = limesurvey_control[ |
|
|
|
"score" |
|
|
|
].sum() |
|
|
|
|
|
|
|
if "demand_control_ratio" in requested_features: |
|
|
|
if "limesurvey_demand_control_ratio" in requested_features: |
|
|
|
limesurvey_demand_control_ratio = ( |
|
|
|
limesurvey_demand["score"].sum() / limesurvey_control["score"].sum() |
|
|
|
) |
|
|
@ -167,10 +167,10 @@ if not participant_info.empty: |
|
|
|
limesurvey_quartile = np.nan |
|
|
|
|
|
|
|
baseline_features.loc[ |
|
|
|
0, "demand_control_ratio" |
|
|
|
0, "limesurvey_demand_control_ratio" |
|
|
|
] = limesurvey_demand_control_ratio |
|
|
|
baseline_features.loc[ |
|
|
|
0, "demand_control_ratio_quartile" |
|
|
|
0, "limesurvey_demand_control_ratio_quartile" |
|
|
|
] = limesurvey_quartile |
|
|
|
|
|
|
|
if not baseline_interim.empty: |
|
|
|