Hey guys so I have these text files that I populated with data from reading and storing values from a CSV. Now I have to "Clean" the data by replacing missing data or zeros/nan's with the value that is located previously, afterward or and average. I am a bit confused with how to go about doing this. Are there any ideas on how this could be done.
Depends on the format of the file, you should show us your attempt at what you've tried.
You'd have some sort of loop, and a variable to keep track of the last good value (if replacing with the "value that is located previously").
The "missing" check depends on the format of the file.
The 0 check is easy enough, just if(data[i] == 0).
The NaN check can be done with isnan: http://www.cplusplus.com/reference/cmath/isnan/