scipp.nan_to_num¶
- scipp.nan_to_num(x, *, nan=None, posinf=None, neginf=None, out=None)¶
Element-wise special value replacement.
All elements in the output are identical to input except in the presence of a NaN, Inf or -Inf. The function allows replacements to be separately specified for NaN, Inf or -Inf values. You can choose to replace a subset of those special values by providing just the required keyword arguments.
- Parameters
x (scipp._scipp.core.Variable) – Input data.
nan (Optional[scipp._scipp.core.Variable]) – Replacement values for NaN in the input.
posinf (Optional[scipp._scipp.core.Variable]) – Replacement values for Inf in the input.
neginf (Optional[scipp._scipp.core.Variable]) – Replacement values for -Inf in the input.
out (Optional[scipp._scipp.core.Variable]) – Optional output buffer.
- Raises
If the types of input and replacement do not match.
- Returns
Input with specified substitutions.
- Return type