numpy.getbuffer
-
numpy.getbuffer(obj[, offset[, size]])
-
Create a buffer object from the given object referencing a slice of length size starting at offset.
Default is the entire buffer. A read-write buffer is attempted followed by a read-only buffer.
Parameters: obj : object
offset : int, optional
size : int, optional
Returns: buffer_obj : buffer
Examples
>>> buf = np.getbuffer(np.ones(5), 1, 3) >>> len(buf) 3 >>> buf[0] '\x00' >>> buf <read-write buffer for 0x8af1e70, size 3, offset 1 at 0x8ba4ec0>
© 2008–2017 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.getbuffer.html