ak.nan_to_num
-------------

.. py:module: ak.nan_to_num

Defined in `awkward.operations.ak_nan_to_num <https://github.com/scikit-hep/awkward/blob/36da52cfa8846355c390beb6555eac1d31c27c26/src/awkward/operations/ak_nan_to_num.py>`__ on `line 20 <https://github.com/scikit-hep/awkward/blob/36da52cfa8846355c390beb6555eac1d31c27c26/src/awkward/operations/ak_nan_to_num.py#L20>`__.

.. py:function:: ak.nan_to_num(array, copy=True, nan=0.0, posinf=None, neginf=None, *, highlevel=True, behavior=None, attrs=None)


    :param array: Array-like data (anything :py:obj:`ak.to_layout` recognizes).
    :param copy: Ignored (Awkward Arrays are immutable).
    :type copy: bool
    :param nan: Value to be used to fill ``NaN`` values.
    :type nan: int, float, broadcastable array
    :param posinf: Value to be used to fill positive infinity
               values. If None, positive infinities are replaced with a very large number.
    :type posinf: None, int, float, broadcastable array
    :param neginf: Value to be used to fill negative infinity
               values. If None, negative infinities are replaced with a very small number.
    :type neginf: None, int, float, broadcastable array
    :param highlevel: If True, return an :py:obj:`ak.Array`; otherwise, return
                  a low-level :py:obj:`ak.contents.Content` subclass.
    :type highlevel: bool
    :param behavior: Custom :py:obj:`ak.behavior` for the output array, if
                 high-level.
    :type behavior: None or dict
    :param attrs: Custom attributes for the output array, if
              high-level.
    :type attrs: None or dict

Implements `np.nan_to_num <https://numpy.org/doc/stable/reference/generated/numpy.nan_to_num.html>`__
for Awkward Arrays, which replaces NaN ("not a number") or infinity with specified values.

See also :py:obj:`ak.nan_to_none` to convert NaN to None, i.e. missing values with option-type.