colour.utilities.fill_nan#
- colour.utilities.fill_nan(a: ArrayLike, method: Literal['Interpolation', 'Constant'] | str = 'Interpolation', default: Real = 0) NDArray[source]#
Fill the NaN values in the specified array \(a\) using the specified method.
- Parameters:
- Returns:
NaN-filled array \(a\).
- Return type:
Examples
>>> a = np.array([0.1, 0.2, np.nan, 0.4, 0.5]) >>> fill_nan(a) array([ 0.1, 0.2, 0.3, 0.4, 0.5]) >>> fill_nan(a, method="Constant") array([ 0.1, 0.2, 0. , 0.4, 0.5])