Accessing data buffers in numpy scalars

Lisandro Dalcin dalcinl at
Tue Oct 17 13:03:41 CDT 2006

On 10/17/06, Travis Oliphant <oliphant at> wrote:
> Or you can use the Python C-API
> const char *buffer;
> Py_ssize_t buflen;
> PyObject_AsReadBuffer(scalar, (const void **)&buffer, &buflen)
> to retrieve a pointer to the data in buffer and the size of the data in
> buflen.

Travis. Have numpy something similar to a mutable scalar, or the only
way is using an array whit only one element?

Lisandro Dalcín
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

More information about the Numpy-discussion mailing list