According to the source code, it is a known issue that the rolling mean calculation ends up with a trace too short. There is a patch that adds a zero in that case. The reason for the bug is an integer division in int(abs(len(data_arr) - len(rol_mean))/2) which means that it only works precisely if len(data_arr) - len(rol_mean) is a multiple of 2.
Instead of a fix, I propose to dump the whole function and use scipy.ndimage.filters.uniform_filter1d which does exactly what we need but faster and better (handles edges well). (See pull request)
According to the source code, it is a known issue that the rolling mean calculation ends up with a trace too short. There is a patch that adds a zero in that case. The reason for the bug is an integer division in
int(abs(len(data_arr) - len(rol_mean))/2)
which means that it only works precisely iflen(data_arr) - len(rol_mean)
is a multiple of 2.Instead of a fix, I propose to dump the whole function and use
scipy.ndimage.filters.uniform_filter1d
which does exactly what we need but faster and better (handles edges well). (See pull request)