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
Raises

If the types of input and replacement do not match.

Returns

Input with specified substitutions.

Return type

scipp._scipp.core.Variable