It you're into reading ancient history here is the link to the discussion where Zachary Pincus makes the same observation and my response was to close the PR because I could use scipy.ndimage.generic_filter, even though at least through my eyes, my implementation was nicer.
http://numpy-discussion.10968.n7.nabble.com/Fwd-numpy-ENH-Initial-implementation-of-a-neighbor-calculation-303-td27508.html

On Sat, Aug 5, 2017 at 7:56 PM Stefan van der Walt <stefanv@berkeley.edu> wrote:
On Fri, Aug 4, 2017, at 19:54, Tim Cera wrote:
As noted https://github.com/numpy/numpy/pull/303 a large part of this functionality has been implemented before for numpy and didn't go anywhere because it is already present in scipy.ndimage.

IMHO it is better suited in numpy with a better name so that people don't miss it.

Is this essentially `scipy.ndimage.generic_filter`?

Stéfan

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion