PyTables create_array fails to save numpy array

45 views
Skip to first unread message

Gary Kshepitzki

unread,
Aug 17, 2020, 3:03:36 AM8/17/20
to pytables-users

Why does the snipped below give:


"TypeError: Array objects cannot currently deal with void, unicode or object arrays"?


Python 3.8.2, tables 3.6.1, numpy 1.19.1

import numpy as np
import tables as tb
TYPE
= np.dtype([ ('d', 'f4') ])

with tb.open_file(r'c:\temp\file.h5', mode="a") as h5file:
    h5file
.create_group(h5file.root, 'grp')
    arr
= np.array([(1.1)], dtype=TYPE)
   
h5file.create_array('/grp', str('arr'), arr)

Reply all
Reply to author
Forward
0 new messages