January 2019
Intermediate to advanced
390 pages
9h 16m
English
Let's first create an HDF5 file from the numeric data we have in the temp.csv file with the following steps:
import numpy as nparr = np.loadtxt('temp.csv', skiprows=1, usecols=(2,3), delimiter=',')
import tablesh5filename = 'pytable_demo.hdf5'with tables.open_file(h5filename,mode='w') as h5file:
root = h5file.root
h5file.create_array(root,'global_power',arr)
h5file.close()
Let's read the file and print the dataset to make sure it is properly written:
with tables.open_file(h5filename,mode='r') as h5file: root = ...
Read now
Unlock full access