[Numpy-discussion] NumPy C-API equivalent of np.float64()

Keith Goodman kwgoodman at gmail.com
Wed Dec 29 15:13:03 EST 2010


On Wed, Dec 29, 2010 at 11:54 AM, Pauli Virtanen <pav at iki.fi> wrote:
> Keith Goodman wrote:
>> np.float64 is fast, just hoping someone had a C-API inline version of
>> np.float64() that is faster.
>
> You're looking for PyArrayScalar_New and _ASSIGN.
> See https://github.com/numpy/numpy/blob/master/numpy/core/include/numpy/arrayscalars.h
>
> Undocumented (bad), but AFAIK public.

Those look nice. I'm stuck since I can't cimport them. I'll have to
read up on how to tell cython about those functions.



More information about the NumPy-Discussion mailing list