Skip to content

Instantly share code, notes, and snippets.

@loopingleo
Last active September 3, 2018 17:57
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 loopingleo/5fde0cb12e801923cd3a8eaf84acf671 to your computer and use it in GitHub Desktop.
Save loopingleo/5fde0cb12e801923cd3a8eaf84acf671 to your computer and use it in GitHub Desktop.
# select relevant columns
df_compressed = df_sensorData[["loggingTime(txt)",
"locationTimestamp_since1970(s)",
"loggingSample(N)",
"locationLatitude(WGS84)",
"locationLongitude(WGS84)",
"locationAltitude(m)",
"locationSpeed(m/s)",
"accelerometerTimestamp_sinceReboot(s)",
"accelerometerAccelerationX(G)",
"accelerometerAccelerationY(G)",
"accelerometerAccelerationZ(G)",
"gyroRotationX(rad/s)",
"gyroRotationY(rad/s)",
"gyroRotationZ(rad/s)"]]
# shorten names of columns
df_compressed = df_compressed.rename(index=str,
columns={
"loggingTime(txt)":"time",
"locationTimestamp_since1970(s)":"time_s1970",
"loggingSample(N)":"sample_ind",
"locationLatitude(WGS84)":"lat",
"locationLongitude(WGS84)":"lon",
"locationAltitude(m)":"altitude",
"locationSpeed(m/s)":"speed",
"accelerometerTimestamp_sinceReboot(s)":"accel_time",
"accelerometerAccelerationX(G)":"x",
"accelerometerAccelerationY(G)":"y",
"accelerometerAccelerationZ(G)":"z",
"gyroRotationX(rad/s)":"Xgyro",
"gyroRotationY(rad/s)":"Ygyro",
"gyroRotationZ(rad/s)":"Zgyro"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment