linear_imputer

lstchain.reco.utils.linear_imputer(y, missing_values=nan, copy=True)

Replace missing values in y with values from a linear interpolation on their position in the array.

Parameters:
y: list or `numpy.array`
missing_values: number, string, np.nan or None, default=`np.nan`

The placeholder for the missing values. All occurrences of missing_values will be imputed.

copybool, default=True

If True, a copy of X will be created. If False, imputation will be done in-place whenever possible.

Returns:
`numpy.array`array with missing_values imputed