On Fri, Jun 18, 2010 at 09:39, Benjamin Root wrote:
> Just for my own knowledge, would Robert's suggestion of using '>i2' as the
> dtype be considered the "best" solution, mostly because of its simplicity,
> but also because it does not assume the endian-ness of the host computer?
It does come w
On Fri, Jun 18, 2010 at 6:15 AM, Sturla Molden wrote:
> Den 17.06.2010 16:29, skrev greg whittier:
> > I have files (from an external source) that contain ~10 GB of
> > big-endian uint16's that I need to read into a series of arrays. What
> > I'm doing now is
> >
> > import numpy as np
> > impor
Den 17.06.2010 16:29, skrev greg whittier:
> I have files (from an external source) that contain ~10 GB of
> big-endian uint16's that I need to read into a series of arrays. What
> I'm doing now is
>
> import numpy as np
> import struct
>
> fd = open('file.raw', 'rb')
>
> for n in range(1)
>
On Thu, Jun 17, 2010 at 12:11 PM, Peter
wrote:
> On Thu, Jun 17, 2010 at 3:29 PM, greg whittier wrote:
> I'm unclear if you want a numpy array or a standard library array,
> but can you exploit the fact that struct.unpack returns a tuple? e.g.
>
> struct.unpack(">%iH" % count, fd.read(2*count))
>
On Thu, Jun 17, 2010 at 3:29 PM, greg whittier wrote:
>
> I have files (from an external source) that contain ~10 GB of
> big-endian uint16's that I need to read into a series of arrays. What
> I'm doing now is
>
> import numpy as np
> import struct
>
> fd = open('file.raw', 'rb')
>
> for n in ra
On Thu, Jun 17, 2010 at 10:41 AM, Robert Kern wrote:
> On Thu, Jun 17, 2010 at 09:29, greg whittier wrote:
>> I have files (from an external source) that contain ~10 GB of
>> big-endian uint16's that I need to read into a series of arrays.
>
> np.fromfile(filename, dtype='>i2')
>
> --
> Robert Ke
On Thu, Jun 17, 2010 at 09:46, Francesc Alted wrote:
> A Thursday 17 June 2010 16:29:54 greg whittier escrigué:
>> I have files (from an external source) that contain ~10 GB of
>> big-endian uint16's that I need to read into a series of arrays. What
>> I'm doing now is
>>
>> import numpy as np
>>
A Thursday 17 June 2010 16:29:54 greg whittier escrigué:
> I have files (from an external source) that contain ~10 GB of
> big-endian uint16's that I need to read into a series of arrays. What
> I'm doing now is
>
> import numpy as np
> import struct
>
> fd = open('file.raw', 'rb')
>
> for n in
On Thu, Jun 17, 2010 at 09:29, greg whittier wrote:
> I have files (from an external source) that contain ~10 GB of
> big-endian uint16's that I need to read into a series of arrays.
np.fromfile(filename, dtype='>i2')
--
Robert Kern
"I have come to believe that the whole world is an enigma, a
I have files (from an external source) that contain ~10 GB of
big-endian uint16's that I need to read into a series of arrays. What
I'm doing now is
import numpy as np
import struct
fd = open('file.raw', 'rb')
for n in range(1)
count = 1024*1024
a = np.array([struct.unpack('>H', fd.
10 matches
Mail list logo