-3

I'm trying to create some moving averages on data that has missing values.

The way i see it i have two options:

1) I can fill these points in with the last known value. The problem is, i think this will mess with the integrity of the moving average feature.

2) I can set these values as NaN. This results in having moving averages that are NaN. The problem with this is that i'm not sure how i would handle a NaN feature. I could fill the NaN with 0, but again a moving average of 0 is not the same as an unknown moving average.

But options seem to cause some integrity issues. Has anyone else had experience with a similar problem?

  • 1
    This isn't the best place to ask these type of questions. Stack Overflow is more about the *how* to do this type of work with code. Perhaps there may be a better place to ask these types of questions? – MattR Sep 23 '19 at 14:49

1 Answers1

0

You can fill them with the moving average untill the NaN (predict those values based on previous values). It is kind of continuous moving average.

Dor
  • 176
  • 1
  • 5