Bug in retrieveTrustworthyOriginal
The function lib.tools.retrieveTrustworthyOriginal
fails for the following minimal example:
from saqc.flagger import SimpleFlagger
from saqc.lib.tools import retrieveTrustworthyOriginal
data = pd.DataFrame(data=0, columns=["var"], index=pd.date_range("2000-01-01", periods=2, freq="D"))
retrieveTrustworthyOriginal(data, data.columns[0], SimpleFlagger().initFlags(data))
The problem seems to be, that for series with an index frequency of "D"
, the statement seconds_rate = dataseries.index.to_series().diff().min().seconds
yields 0
which later on produces a ZeroDivisionError
.
As I am not sure, what the exact idea behind the function is, I m not sure, how to fix this. I guee @luenensc might have a better idea...