[Numpy-discussion] str/bytes object from arr.data?

Francesc Alted faltet@pytables....
Mon Sep 27 07:28:21 CDT 2010


Hi,

Anybody knows a way to get a str object (bytes for Python >= 2.6) out of 
a buffer object (i.e. the .data attribute of ndarrays) without copying 
data?

I need this for avoid creating a new function that deals with buffer 
objects (instead of reusing the one for str/byte objects that I already 
have).  So, a matter of laziness :-)

Thanks,

-- 
Francesc Alted


More information about the NumPy-Discussion mailing list