Agreed that indexing functions should return bare `ndarray`. Note that in
Jaime's PR one can override it anyway by defining __nonzero__. -- Marten
On Sat, May 9, 2015 at 9:53 PM, Stephan Hoyer sho...@gmail.com wrote:
With regards to np.where -- shouldn't where be a ufunc, so subclasses or
On May 9, 2015 12:54 PM, Benjamin Root ben.r...@ou.edu wrote:
Absolutely, it should be writable. As for subclassing, that might be
messy. Consider the following:
inds = np.where(data 5)
In that case, I'd expect a normal, bog-standard ndarray because that is
what you use for indexing
On Sat, May 9, 2015 at 1:27 PM, Benjamin Root ben.r...@ou.edu wrote:
On Sat, May 9, 2015 at 4:03 PM, Nathaniel Smith n...@pobox.com wrote:
Not sure what this has to do with Jaime's post about nonzero? There is
indeed a potential question about what 3-argument where() should do with
With regards to np.where -- shouldn't where be a ufunc, so subclasses or other
array-likes can be control its behavior with __numpy_ufunc__?
As for the other indexing functions, I don't have a strong opinion about how
they should handle subclasses. But it is certainly tricky to attempt to
On Sat, May 9, 2015 at 4:03 PM, Nathaniel Smith n...@pobox.com wrote:
Not sure what this has to do with Jaime's post about nonzero? There is
indeed a potential question about what 3-argument where() should do with
subclasses, but that's effectively a different operation entirely and to
There is a reported bug (issue #5837
https://github.com/numpy/numpy/issues/5837) regarding different returns
from np.nonzero with 1-D vs higher dimensional arrays. A full summary of
the differences can be seen from the following output:
class C(np.ndarray): pass
...
a = np.arange(6).view(C)
b
On May 9, 2015 10:48 AM, Jaime Fernández del Río jaime.f...@gmail.com
wrote:
There is a reported bug (issue #5837) regarding different returns from
np.nonzero with 1-D vs higher dimensional arrays. A full summary of the
differences can be seen from the following output:
class C(np.ndarray):
Absolutely, it should be writable. As for subclassing, that might be messy.
Consider the following:
inds = np.where(data 5)
In that case, I'd expect a normal, bog-standard ndarray because that is
what you use for indexing (although pandas might have a good argument for
having it return one of