I have a time series in a log file having the following form (timestamp, value) :
1433787443, -60
1433787450, -65
1433787470, -57
1433787483, -70
Is there any available python code/library that takes as input the log file and a window size, apply a median filter to the time series to remove noise and outliers, and outputs the filtered signal to a new file ?
Load the data using any method you prefer. I see that your file can be treated as csv format, therefore you could use
numpy.genfromtxt('file.csv', delimiter=',')
function.Use the scipy function for median filtering:
scipy.signal.medfilt(data, window_len)
. Keep in mind that window length must be odd number.Save the results to a file. You can do it for example by using the
numpy.savetxt('out.csv', data, delimiter=',')
function.