[Numpy-discussion] "expected a single-segment buffer object"

Anne Archibald peridot.faceted at gmail.com
Thu Jul 10 11:33:58 EDT 2008


2008/7/9 Robert Kern <robert.kern at gmail.com>:

> Because that's just what a buffer= argument *is*. It is not a place
> for presenting the starting pointer to exotically-strided memory. Use
> __array_interface__s to describe the full range of representable
> memory. See below.

Aha! Is this stuff documented somewhere?

> I was about a week ahead of you. See numpy/lib/stride_tricks.py in the trunk.

Nice! Unfortunately it can't quite do what I want... for the linear
algebra I need something that can broadcast all but certain axes. For
example, take an array of matrices and an array of vectors. The
"array" axes need broadcasting, but you can't broadcast on all axes
without (incorrectly) turning the vector into a matrix. I've written a
(messy) implementation, but the corner cases are giving me headaches.
I'll let you know when I have something that works.

Thanks,
Anne



More information about the NumPy-Discussion mailing list