ak.nan_to_num#
Defined in awkward.operations.ak_nan_to_num on line 11.
- ak.nan_to_num(array, copy=True, nan=0.0, posinf=None, neginf=None, *, highlevel=True, behavior=None)#
 - Parameters
 array – Array-like data (anything
ak.to_layoutrecognizes).copy (bool) – Ignored (Awkward Arrays are immutable).
nan (int, float, broadcastable array) – Value to be used to fill
NaNvalues.posinf (None, int, float, broadcastable array) – Value to be used to fill positive infinity values. If None, positive infinities are replaced with a very large number.
neginf (None, int, float, broadcastable array) – Value to be used to fill negative infinity values. If None, negative infinities are replaced with a very small number.
highlevel (bool) – If True, return an
ak.Array; otherwise, return a low-levelak.contents.Contentsubclass.behavior (None or dict) – Custom
ak.behaviorfor the output array, if high-level.
Implements np.nan_to_num for Awkward Arrays, which replaces NaN (“not a number”) or infinity with specified values.
See also ak.nan_to_none to convert NaN to None, i.e. missing values with option-type.