[Numpy-discussion] Rewrite np.histogram in c?

Jaime Fernández del Río jaime.frio at gmail.com
Mon Mar 16 09:56:58 EDT 2015


On Sun, Mar 15, 2015 at 11:06 PM, Robert McGibbon <rmcgibbo at gmail.com>
wrote:

> It might make sense to dispatch to difference c implements if the bins are
> equally spaced (as created by using an integer for the np.histogram bins
> argument), vs. non-equally-spaced bins.
>

Dispatching to a different method seems like a no brainer indeed. The
question is whether we really need to do this in C. Maybe for some very
specific case or cases it makes sense to have a super fast C path, e,g. no
weights and bins is an integer. Even then, rather than rewriting the whole
thing in C, it may be a better idea to leave the parsing of the inputs in
Python, and have a C helper function wrapped and privately exposed,
similarly to how `np.core.multiarray.interp` is used by `np.interp`.

But I would still first give it a try in Python...

Jaime

-- 
(\__/)
( O.o)
( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes
de dominación mundial.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150316/885ed415/attachment.html>


More information about the NumPy-Discussion mailing list