[Numpy-tickets] [NumPy] #422: __getitem__ method of MaskedArray returns ndarray in some cases
NumPy
numpy-tickets at scipy.net
Fri Jan 12 14:29:25 CST 2007
#422: __getitem__ method of MaskedArray returns ndarray in some cases
------------------------+---------------------------------------------------
Reporter: reggie | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: numpy.core | Version:
Severity: normal | Keywords:
------------------------+---------------------------------------------------
When using extended slicing on a MaskedArray with its mask set to nomask,
the {{{__getitem__}}} method (called because of the *extended* slicing)
will return only the data portion of the MaskedArray thereby causing the
result of your slicing operation to be an ndarray instead of a
MaskedArray.
I'm attaching a patch that seems to fix this problem and also eliminates
the {{{__getslice__}}} and {{{__setslice__}}} methods as I believe they're
only needed in Python versions prior to 2.0 which aren't supported by
numpy, if I'm not mistaken.
--
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/422>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list