Best regards,
Luiz Vitor.
import h5py
import numpy as np
wrangler_type = {
'names': ['dst_ip', 'src_ip', 'payload_type', 'payload', 'timestamp'],
'formats': ['|S15', '|S15', 'i4', '|S100', 'i4']
}
f = h5py.File('/tmp/PriceCheckWrite.h5', 'w')
dgroup = f.create_group('PCAnalytics')
CHUNCK = 100
dset = dgroup.create_dataset('PCWrangler',
shape=(CHUNCK,),
dtype=price_check_wrangler_type,
maxshape=(None,),
compression='gzip',
compression_opts=9)
write_count = 1
for i in [(...), (...), ...]:
if not (write_count % CHUNCK):
dset.resize((write_count+CHUNCK,))
dset[write_count] = np.array(i, dtype=price_check_wrangler_type)
write_count += 1
dset.resize(write_count, 0)
--
You received this message because you are subscribed to the Google Groups "h5py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h5py+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.