R: NaNs produced
As I said in my comment, to know which observation generated the NaN, you can use function which:
As I said in my comment, to know which observation generated the NaN, you can use function which:
A simple way to achieve this is by using np.convolve. The idea behind this is to leverage the way the discrete convolution is computed and use it to return a rolling mean. This can be done by convolving with a sequence of np.ones of a length equal to the sliding window length we want. In order to do so we could … Read more