On Sat, Feb 25, 2012 at 19:50, Janwillem <[email protected]> wrote:
> I have a buffer as a numpy array of uint16. Chunks of this buffer are
> unicode characters. How do I get these chunks, say data[start:end], in a
> string?
data[sart:end].tostring().decode('UTF-16LE')
or 'UTF-16BE' if they are big-endian.
> Other chunks are 32bit integers how do I get these chunks into a numpy
> array of int32?
data[start:end].view(np.int32)
--
Robert Kern
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion