Interpolate missing values in a tensor

Hi, @albanD @ptrblck
I have temporal discrete information which may have missing values.
I do have a mask indicating where are those values too.

How can I perform an efficient interpolation filling those values?

In practice I have a TxCxJ tensor (Q). Some elements are let’s say corrupted. I would like, given a corrupted element Q[t,c,j], to fill that value with an interpolation between Q[t-1,c,j] and Q[t+1,c,j]

Also, in the worst case I may have several consecutive corrupted elements:
to be filled with the interpolation between
Q[t_0-1,c,j] and Q[t_1+1,c,j]

1 Like

Are you dealing with tensors at this point or could you use e.g. pandas for your use case, as it provides some convenient features to fill these missing values?