[Numpy-discussion] [numpy] ENH: Initial implementation of a 'neighbor' calculation (#303)
Mon Oct 15 08:36:16 CDT 2012
On Sun, Oct 14, 2012 at 8:24 PM, Zachary Pincus <email@example.com>wrote:
> It would be useful for the author of the PR to post a detailed comparison
> of this functionality with scipy.ndimage.generic_filter, which appears to
> have very similar functionality.
I'll be durned. I created neighbor because I didn't find what I wanted,
and to find now that I just didn't look in the right place is well ...
Let's just say that I went for a long run last night.
Searching for ndimage, I found that is has been around a long, long time.
First in numarray, then moved to scipy.
Really I could only nitpick about minor differences - kinda like a primary
political campaign. On the face of it though, generic_filter looks better.
First off it is written in C so likely will be faster and more efficient
memory use. I didn't look at optimizing neighbor at all and at least my
part of it is pure Python. Of course for all of the small differences, I
like my choices better. :-)
I would like to make a mild suggestion. Emphasis on mild. Maybe ndimage,
in all or in part, should be brought into (back into?) Numpy and renamed.
About the PR. Given that the neighbor functionality exists already, I will
close the PR later today. Move along, nothing to see here...
Side note: I wrote arraypad with the future idea that it would become
easyish to include that functionality in other places, for example in
neighbor. A Don't Repeat Yourself idea. Previously I had only seen
Fortran pad capabilities in some of the Fast Fourier Transform functions.
The generic_filter function includes several padding functions - written in
C. This means that if arraypad needs be more efficient we have C code to
base a better arraypad.
Another side node: The measurements functions in ndimage are called zonal
functions in the GIS field.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion