nanInfFill

Syntax

nanInfFill(X,Y)

Arguments

X is a floating-point number of any data form except for set.

Y is a floating-point number.

Details

In DolphinDB, NaN and Inf values of floating-point numbers are replaced with NULL values. Nan and Inf values can arise in the course of data import, or during calculations involving external data sources.

This function replaces the NaN/Inf value in X with the specified Y.

Note:

When X is a dictionary, only dictionary values are replaced.

Examples

x = [float(`inf), 2, 3, float(`nan), 5, 6, 7]
nanInfFill (x, 2.2)

x = matrix(1..3, [float(`inf), float(`nan), 1.0])
nanInfFill(x, 1.2)

Related functions: isNanInf, countNanInf