datafile: pattern1.ktx
import numpy as np
data = np.fromfile('pattern1.ktx', dtype=np.byte)
print ('endianness:', hex(data[12:13]))
Result: TypeError: only integer scalar arrays can be converted to a scalar index
Looks simple enough? I'm not getting it though. How to fix this? Thank You.
How about this one?
b = np.frombuffer(np.array(data[12:12+4], dtype=np.byte), dtype=np.uint32)
print ('endianess:', hex(b))
Same error. How to fix?
hex(data[12])