Last active
October 3, 2023 21:27
-
-
Save petrosDemetrakopoulos/95616207bbaf3490679850d18ffb29d4 to your computer and use it in GitHub Desktop.
Fall Detector - Normalize data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def normalize(data): | |
data_norm = data.copy() | |
columns_for_normalization = ['x_acc','y_acc','z_acc', | |
'x_gravity', 'y_gravity', 'z_gravity', | |
'x_gyro', 'y_gyro', 'z_gyro'] | |
for column in columns_for_normalization: | |
data_norm[column] = (data_norm[column] - data_norm[column].mean()) / data_norm[column].std() | |
return data_norm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment