Hi,
I noticed that SequenceInterpolator doesn't actually handle NaNs when using nearest_neighbor mode, even if keep_nans=False is set.
In interpolators.py, the linear mode has a check to fill NaNs using nanmean, but the nearest_neighbor block just returns the raw data from idx_lower:
if self.interpolation_mode == "nearest_neighbor":
data = self._data[idx_lower]
return (data, valid) if return_valid else data
because of this, interpolate() still returns NaNs when it's supposed to fill them. Is this a bug or am I missing something?
Also, idx_lower uses np.floor, so it’s always looking at the previous index instead of the actual "nearest" one. Just wanted to point that out.
Hi,
I noticed that SequenceInterpolator doesn't actually handle NaNs when using nearest_neighbor mode, even if keep_nans=False is set.
In interpolators.py, the linear mode has a check to fill NaNs using nanmean, but the nearest_neighbor block just returns the raw data from idx_lower:
if self.interpolation_mode == "nearest_neighbor":
data = self._data[idx_lower]
return (data, valid) if return_valid else data
because of this, interpolate() still returns NaNs when it's supposed to fill them. Is this a bug or am I missing something?
Also, idx_lower uses np.floor, so it’s always looking at the previous index instead of the actual "nearest" one. Just wanted to point that out.