[Numpy-discussion] numpy.gradient() does not return ndarray subclasses
rmay31 at gmail.com
Thu Mar 18 14:15:54 EDT 2010
Can I get someone to look at: http://projects.scipy.org/numpy/ticket/1435
Basically, numpy.gradient() uses numpy.zeros() to create an output
array. This breaks the use of any ndarray subclasses, like masked
arrays, since the function will only return
ndarrays. I've attached a patch that fixes that problem and has a
simple test checking output types. With this patch, I can use gradient
on masked arrays and get appropriately masked output.
If we could, it'd be nice to get this in for 2.0 so that I (and my
coworkers who found the bug) don't have to use a custom patched
gradient until the next release after that.
Graduate Research Assistant
School of Meteorology
University of Oklahoma
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1200 bytes
Desc: not available
More information about the NumPy-Discussion