pygeneactiv is a python package for reading GENEActiv watch data. Here's a simple example
import json
import pygeneactiv
# read a GENEActiv dataset
ds = pygeneactiv.read(filename)
# print file headers (using json.dumps only to nicely print a dict)
print(json.dumps(ds.headers, indent=2))
# process data in chunks
for chunk in ds.get_data(chunksize=1000):
print(chunk.shape) # (1000, 7)
Note that every row of the GENEActiv files contains a timestamp. You can instruct
ds.get_data
to automatically parse these dates intoTimestamp
objects by passingparsedates=True
, but this will significantly slow down reading. If you really don't need every date parsed, don't pass this.
At the moment, only the full CSV exported files are supported.
Just use pip
pip install pygeneactiv