I fromfile
using a structured dtype and have one field that is raw hexbytes ('V2) - it looks like this:
[[b'\x00\x00', b'\x05\x01', b'\x00\x00', b'\x00\x00', b'\x00\x00' .....],
...
[b'\x00\x00', b'\x05\x01', b'\x00\x00', b'\x00\x00', b'\x00\x00' .....]] - the sub-array is shape (44640, 50)
I'd like to decode this entire array into string literals and keep the same shape (e.g. each 2byte chunk from b'\x05\x01' into '0501')
Tried iterating through using bytes.hex() instance method but doesn't keep the 2bytes x 50 structure ..
Always extremely grateful for your time and advice...
copied from comment with guess as to line breaks
dt3 = np.dtype([('DIG', 'u1', (digField)), ('ANL', 'V2', (anField)), ('MSG', 'u1', (260 - digField - (anField * 2))), ('DAT', 'u1', (20))])
raw_ry = np.fromfile(logpath, dtype=dt3, count=-1)
dt4 = np.dtype('U')
anDecode_ry = np.array([item.hex() for item in raw_ry['ANL']], dtype=dt4)