MCPcopy Index your code
hub / github.com/numpy/numpy / test_setting_fill_value_attribute

Function test_setting_fill_value_attribute

numpy/ma/tests/test_core.py:5819–5831  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5817
5818
5819def test_setting_fill_value_attribute():
5820 # Regression test for gh-29421: setting .fill_value post-construction works too
5821 dt = np.dtypes.StringDType()
5822 arr = np.ma.MaskedArray(
5823 ["x", "longstring", "mid"], mask=[False, True, False], dtype=dt
5824 )
5825 # Setting the attribute should not raise
5826 arr.fill_value = "Z"
5827 assert arr.fill_value == "Z"
5828 # And filled() should use the new fill_value
5829 assert arr.filled()[0] == "x"
5830 assert arr.filled()[1] == "Z"
5831 assert arr.filled()[2] == "mid"
5832
5833
5834def test_ufunc_with_output():

Callers

nothing calls this directly

Calls 1

filledMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…