MCPcopy Create free account
hub / github.com/numpy/numpy / harden_mask

Method harden_mask

numpy/ma/core.py:3553–3569  ·  view source on GitHub ↗

Force the mask to hard, preventing unmasking by assignment. Whether the mask of a masked array is hard or soft is determined by its `~ma.MaskedArray.hardmask` property. `harden_mask` sets `~ma.MaskedArray.hardmask` to ``True`` (and returns the modified self)

(self)

Source from the content-addressed store, hash-verified

3551 raise NotImplementedError("Coming soon: setting the mask per records!")
3552
3553 def harden_mask(self):
3554 """
3555 Force the mask to hard, preventing unmasking by assignment.
3556
3557 Whether the mask of a masked array is hard or soft is determined by
3558 its `~ma.MaskedArray.hardmask` property. `harden_mask` sets
3559 `~ma.MaskedArray.hardmask` to ``True`` (and returns the modified
3560 self).
3561
3562 See Also
3563 --------
3564 ma.MaskedArray.hardmask
3565 ma.MaskedArray.soften_mask
3566
3567 """
3568 self._hardmask = True
3569 return self
3570
3571 def soften_mask(self):
3572 """

Callers 6

test_hardmaskMethod · 0.45
test_hardmaskMethod · 0.45
test_putmaskMethod · 0.45
test_setitemMethod · 0.45

Calls

no outgoing calls

Tested by 6

test_hardmaskMethod · 0.36
test_hardmaskMethod · 0.36
test_putmaskMethod · 0.36
test_setitemMethod · 0.36