Return the next value, or raise StopIteration. Examples -------- >>> x = np.ma.array([3, 2], mask=[0, 1]) >>> fl = x.flat >>> next(fl) 3 >>> next(fl) masked >>> next(fl) Traceback (most recent call last):
(self)
| 2667 | self.maskiter[index] = getmaskarray(value) |
| 2668 | |
| 2669 | def __next__(self): |
| 2670 | """ |
| 2671 | Return the next value, or raise StopIteration. |
| 2672 | |
| 2673 | Examples |
| 2674 | -------- |
| 2675 | >>> x = np.ma.array([3, 2], mask=[0, 1]) |
| 2676 | >>> fl = x.flat |
| 2677 | >>> next(fl) |
| 2678 | 3 |
| 2679 | >>> next(fl) |
| 2680 | masked |
| 2681 | >>> next(fl) |
| 2682 | Traceback (most recent call last): |
| 2683 | ... |
| 2684 | StopIteration |
| 2685 | |
| 2686 | """ |
| 2687 | d = next(self.dataiter) |
| 2688 | if self.maskiter is not None: |
| 2689 | m = next(self.maskiter) |
| 2690 | if isinstance(m, np.void): |
| 2691 | return mvoid(d, mask=m, hardmask=self.ma._hardmask) |
| 2692 | elif m: # Just a scalar, masked |
| 2693 | return masked |
| 2694 | return d |
| 2695 | |
| 2696 | |
| 2697 | class MaskedArray(ndarray): |
no test coverage detected