Re: np.ndenumerate doesn't obey mask?
On 22 Oct 2024, at 18:00, numpy-discussion-request@python.org wrote:
From: Neal Becker <ndbecker2@gmail.com> Subject: [Numpy-discussion] np.ndenumerate doesn't obey mask? Date: 21 October 2024 at 18:52:41 CEST To: Discussion of Numerical Python <numpy-discussion@python.org> Reply-To: Discussion of Numerical Python <numpy-discussion@python.org>
I was using ndenuerate with a masked array, and it seems that the mask is ignored. Is this true? If so, isn't that a bug?
This is expected behaviour: you should use the function from the “.ma" namespace “numpy.ma.ndenumerate" <https://numpy.org/devdocs/reference/generated/numpy.ma.ndenumerate.html#nump...> for skipping masked elements. By design numpy.enumerate does not skip masked elements. Stefano
participants (1)
-
Stefano Miccoli