apply_fill_on_write¶
- swxsoc.io.fillval.apply_fill_on_write(arr: ndarray, mask: ndarray, fillval: Any) ndarray[source]¶
Return a copy of
arrwith fill positions replaced byfillval.Fill positions are the union of:
mask(when provided),NaNvalues (float arrays only),the literal bytes
b"nan"/b"NaN"(string arrays only; write-side convenience for users who passnp.naninto anSorUarray, which numpy coerces to the bytesb"nan").
- Parameters:
arr (array-like) – Source data. Not mutated.
mask (array-like of bool, or None) – Explicit mask of fill positions. Broadcast-compatible with
arr.fillval (scalar or None) – The variable’s
FILLVALattribute. IfNone,arris returned as a copy with no replacements.
- Returns:
numpy.ndarray – A new array with fill positions replaced.