Skip to content

Instantly share code, notes, and snippets.

@petrosDemetrakopoulos
Last active October 3, 2023 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petrosDemetrakopoulos/95616207bbaf3490679850d18ffb29d4 to your computer and use it in GitHub Desktop.
Save petrosDemetrakopoulos/95616207bbaf3490679850d18ffb29d4 to your computer and use it in GitHub Desktop.
Fall Detector - Normalize data
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