I have a 32 bit signed integer .dat file with two arrays where the data is interleaved. I want to open the data into two separate numpy arrays.
I have tried to open it using numpy 'fromfile'.
import numpy as np
newarray = np.fromfile('file.dat',dtype=int)
print newarray
From my file, this prints
[ 83886080 16777216 251658240 ..., 0 50331648 16777216]
Which is odd because I know the two arrays should start like
[ 1 0 0 ...]
[ 15 5 11 ...]
Based on my understanding of the interleaved data I was expecting the above code to give me 1 array which looked something like
[ 1 15 0 5 ...]
Does anyone know where I'm going wrong? I can post the file if it would help.
[ 83886080 16777216 251658240 ..., 0 50331648 16777216], so that didn't appear to work. Note also that I'd prefer this as two arrays also.dtype=np.int32.