ak.nan_to_num

Defined in awkward.operations.structure on line 4079.

ak.nan_to_num(array, copy=True, nan=0.0, posinf=None, neginf=None, highlevel=True, behavior=None)
Parameters
  • array – Array whose NaN values should be converted to a number.

  • copy (bool) – Ignored (Awkward Arrays are immutable).

  • nan (int or float) – Value to be used to fill NaN values.

  • posinf (int, float, or None) – Value to be used to fill positive infinity values. If None, positive infinities are replaced with a very large number.

  • neginf (int, float, or None) – 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-level ak.layout.Content subclass.

  • behavior (None or dict) – Custom ak.behavior for the output array, if high-level.

Implements np.nan_to_num for Awkward Arrays.