Error in flagUniLOF
Summary
flagUniLOF
currently fails.
Reproducible Example
import numpy as np
import pandas as pd
from saqc import SaQC
values = np.array([-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
dates = pd.date_range(start="2020-01-01", periods=len(values), freq="D")
data = pd.DataFrame({"var": values}, index=dates)
qc = SaQC(data=data) #, scheme=AnnotatedFloatScheme())
qc = qc.flagUniLOF("var", thresh=1.5)
What is the current bug behavior?
I get an IndexError
What is the expected correct behavior?
No error.
Stacktrace
File "/home/schaefed/SourceCode/Python/saqc/test.py", line 245, in <module>
qc = qc.flagUniLOF("var", thresh=1.5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/schaefed/SourceCode/Python/saqc/saqc/core/register.py", line 401, in inner
out = func(out, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/schaefed/SourceCode/Python/saqc/saqc/funcs/outliers.py", line 362, in flagUniLOF
qc = self.assignUniLOF(
^^^^^^^^^^^^^^^^^^
File "/home/schaefed/SourceCode/Python/saqc/saqc/core/register.py", line 401, in inner
out = func(out, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/schaefed/SourceCode/Python/saqc/saqc/funcs/scores.py", line 535, in assignUniLOF
list(d_var[:n] + (d_var[0] - d_var[n + 1]))
~~~~~^^^^^^^
IndexError: index 16 is out of bounds for axis 0 with size 15