Fix the accelerometer bug: without evening data
parent
6608e47918
commit
e66ed6a79b
|
@ -75,7 +75,9 @@ def base_accelerometer_features(acc_data, day_segment, requested_features, valid
|
||||||
else:
|
else:
|
||||||
if day_segment != "daily":
|
if day_segment != "daily":
|
||||||
acc_data = acc_data[acc_data["local_day_segment"] == day_segment]
|
acc_data = acc_data[acc_data["local_day_segment"] == day_segment]
|
||||||
if not acc_data.empty:
|
if acc_data.empty:
|
||||||
|
acc_features = pd.DataFrame(columns=["local_date"] + ["acc_" + day_segment + "_" + x for x in features_to_compute])
|
||||||
|
else:
|
||||||
acc_features = pd.DataFrame()
|
acc_features = pd.DataFrame()
|
||||||
# get magnitude related features: magnitude = sqrt(x^2+y^2+z^2)
|
# get magnitude related features: magnitude = sqrt(x^2+y^2+z^2)
|
||||||
magnitude = acc_data.apply(lambda row: np.sqrt(row["double_values_0"] ** 2 + row["double_values_1"] ** 2 + row["double_values_2"] ** 2), axis=1)
|
magnitude = acc_data.apply(lambda row: np.sqrt(row["double_values_0"] ** 2 + row["double_values_1"] ** 2 + row["double_values_2"] ** 2), axis=1)
|
||||||
|
|
Loading…
Reference in New Issue