diff --git a/src/features/phone_esm/straw/main.py b/src/features/phone_esm/straw/main.py index 306bb681..4f5b060b 100644 --- a/src/features/phone_esm/straw/main.py +++ b/src/features/phone_esm/straw/main.py @@ -52,7 +52,6 @@ def straw_features(sensor_data_files, time_segment, provider, filter_data_by_seg if not esm_data.empty: esm_features = pd.DataFrame() - for scale in requested_scales: questionnaire_id = QUESTIONNAIRE_IDS[scale] mask = esm_data["questionnaire_id"] == questionnaire_id @@ -60,4 +59,7 @@ def straw_features(sensor_data_files, time_segment, provider, filter_data_by_seg #TODO Create the column esm_user_score in esm_clean. Currently, this is only done when reversing. esm_features = esm_features.reset_index() + if 'index' in esm_features: # In calse of empty esm_features df + esm_features.rename(columns={'index': 'local_segment'}, inplace=True) + return esm_features