Skip to content

Instantly share code, notes, and snippets.

@anielsen001
Created June 5, 2019 09:07
Show Gist options
  • Save anielsen001/02b63d585c7f24c08e61a8bb7fa731d9 to your computer and use it in GitHub Desktop.
Save anielsen001/02b63d585c7f24c08e61a8bb7fa731d9 to your computer and use it in GitHub Desktop.
example code for parsing android data logger files
# Example code for parsing sensor log files from Andriod apps
import pandas as pd
# SensorDataLogger
# https://play.google.com/store/apps/details?id=es.terrik.SensorLogger
# 'a' and 'b' are empty colums
date_parser = lambda x: pd.datetime.strptime( x, "%Y-%m-%d_%H-%M-%S.%f" )
df2 = pd.read_csv('LOG_2019-06-05_04-17-08MMC3630KJ_Magnetometer.log',
header = None,
skiprows = 1, sep=';',
names = ['index','Timestamp','a', 'x','y','z','b'],
usecols= ['index','Timestamp','x','y','z'],
parse_dates = ['Timestamp'],
date_parser = date_parser )
# Sensor Record - just works without special parsing
df = pd.read_csv('File')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment