npstreams.nan_to_num
- npstreams.nan_to_num(array, fill_value=0.0, copy=True)
Replace NaNs with another fill value.
- Parameters:
array (array_like) – Input data.
fill_value (float, optional) – NaNs will be replaced by
fill_value. Default is 0.0, in keeping withnumpy.nan_to_num.copy (bool, optional) – Whether to create a copy of array (True) or to replace values in-place (False). The in-place operation only occurs if casting to an array does not require a copy.
- Returns:
out – Array without NaNs. If
arraywas not of floating or complearray type,arrayis returned unchanged.- Return type:
ndarray
Notes
Contrary to
numpy.nan_to_num, this functions does not handle infinite values.See also
numpy.nan_to_numreplace NaNs and Infs with zeroes.