Fill NA with 0 for the selected keyboard features

data_cleaning
Meng Li 2021-10-03 17:14:29 -04:00
parent 5f85dd8ca4
commit 9607d8d673
1 changed files with 1 additions and 0 deletions

View File

@ -59,6 +59,7 @@ def rapids_features(sensor_data_files, time_segment, provider, filter_data_by_se
if "totalkeyboardtouches" in features_to_compute:
keyboard_features["totalkeyboardtouches"] = keyboard_data.groupby(['local_segment','sessionNumber'])['is_password'].count().reset_index().groupby(['local_segment'])['is_password'].mean()
keyboard_features.fillna(value={"sessioncount": 0, "averagesessionlength": 0, "changeintextlengthlessthanminusone": 0, "changeintextlengthequaltominusone": 0, "changeintextlengthequaltoone": 0, "changeintextlengthmorethanone": 0, "maxtextlength": 0, "totalkeyboardtouches": 0}, inplace=True)
keyboard_features = keyboard_features.reset_index()
return keyboard_features