Merging structured arrays with mixed dtypes including '|O4'

getdat.dtype
out.dtype
Let's say I have two structured arrays with dtypes as per below dtype([('Tstamp', '|O4'), ('Vf', '<f4'), ('Vq', '<f4'), ('Sf', '<f4'), ('Sq', '<f4'), ('Bt', '<f4'), ('SPL', '<f4')]) dtype([('Viscosity_cSt', '<f4'), ('Density_kgm3', '<f4'), ('GVF', '<f4')]) Then merging this per the below gives an error. Why?
rfn.merge_arrays((getdat, out), flatten = True, usemask = False, asrecarray=False)
Traceback (most recent call last): File "<pyshell#43>", line 1, in <module> rfn.merge_arrays((getdat, out), flatten = True, usemask = False, asrecarray=False) File "C:\Python27\lib\site-packages\numpy\lib\recfunctions.py", line 458, in merge_arrays dtype=newdtype, count=maxlength) ValueError: cannot create object arrays from iterator The issue seems to be object field 'Tstamp' which contains python datetime objects. I can merge structured arrays with numeric formats. Any help much appreciated. Alex van der Spek
participants (1)
-
Alex