mail.python.org
[Tutor] inserting a vector into an array - numpy Q
we should see several ways to do this. One way is with reshape: http://www.scipy.org/Numpy_Example_List_With_Doc#reshape.
we should see several ways to do this. One way is with reshape: http://www.scipy.org/Numpy_Example_List_With_Doc#reshape.
The array 'a' should have the same size as 'string' since I'm using a 1-byte datatype. Is this a bug, or do I need to change the way I use this function in Python 3? I am using Numpy r8523.
In your example code, you've created a Python array of hexadecimal-valued bytes -- which I guess is what you get reading in your "raw" image, so that's OK. But you still have to convert those '\x01', etc., values to Python integers.
array = numpy.fromfile(fileObject, count=count, dtype=dtype).reshape(shape, order='F'). arrays.append(array).Previous message (by thread): [Numpy-discussion] example reading binary Fortran file.