nilmdb/pytables-test/speed-pytables.py

17 lines
405 B
Python
Raw Permalink Normal View History

import tables
import numpy
class RawSample(tables.IsDescription):
timestamp = tables.UInt64Col()
voltage = tables.UInt16Col(shape = 3)
current = tables.UInt16Col(shape = 3)
h5file = tables.openFile("test.h5", mode = "w", title = "Test")
group = h5file.createGroup("/", "raw", "Raw Data")
table = h5file.createTable(group, "nilm1", RawSample, "NILM 1")
print repr(h5file)
# write rows