Re: How to specific multiple dtypes in numpy.ndarray?

2019-12-21 Thread John Ladasky
On Thursday, December 19, 2019 at 2:53:18 AM UTC-8, lampahome wrote: > I meet performance is low when I use struct.unpack to unpack binary data. > > So I tried to use numpy.ndarray > But meet error when I want to unpack multiple dtypes > > Can anyone teach me~ > > Code like below: > # python3 >

Re: How to specific multiple dtypes in numpy.ndarray?

2019-12-19 Thread Thomas Jollans
On 19/12/2019 11.52, lampahome wrote: > I meet performance is low when I use struct.unpack to unpack binary data. > > So I tried to use numpy.ndarray > But meet error when I want to unpack multiple dtypes > > Can anyone teach me~ > > Code like below: > # python3 > import struct > import numpy as

How to specific multiple dtypes in numpy.ndarray?

2019-12-19 Thread lampahome
I meet performance is low when I use struct.unpack to unpack binary data. So I tried to use numpy.ndarray But meet error when I want to unpack multiple dtypes Can anyone teach me~ Code like below: # python3 import struct import numpy as np s1 = struct.Struct("@QIQ") ss1 = s1.pack(1,11,111)