-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
For my time series (where the deviations were very small and sometimes negligent) I was getting the following error:
/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py:3335: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
/usr/local/lib/python3.6/dist-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
And my alpha component was nan (even though the chart was getting built, but the last value of fluct[e] was nAn.
So I changed the code in the dfa.py to accommodate for this problem in the following way (it simply assumes the previous value instead of making it 0 or nan):
if not np.isnan(np.sqrt(np.mean(calc_rms(y, sc)**2))):
fluct[e] = np.sqrt(np.mean(calc_rms(y, sc)**2))
prevalue = fluct[e]
else:
fluct[e] = prevalue
Do you think this is a valid way of addressing this issue? I see that calc_rms is not being calculated, so that's why there's problem I believe.
Here's the data I use (pandas exported as a CSV): https://www.dropbox.com/s/h1yhd45ht1fwe78/xsens_74.csv?dl=0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels