arundo / adtk

A Python toolkit for rule-based/unsupervised anomaly detection in time series
https://adtk.readthedocs.io
Mozilla Public License 2.0
1.06k stars 143 forks source link

runtime error #113

Open kusumy opened 3 years ago

kusumy commented 3 years ago

When running ClassicalDecomposition on the time series data (10 seconds interval), there is an error:

RuntimeError: Series does not follow any known frequency (e.g. second, minute, hour, day, week, month, year, etc.

The time series data has DateTime index.

How to solve the error?

Regards

tailaiw commented 3 years ago

If your time series data following an exact 10 seconds spacing, ADTK should be able to identify it without a problem because it uses inferred_freq in Pandas. Could you check the value of your_series.index.inferred_freq?

deepakvamsi commented 3 years ago

@kusumy try to change frequency by changing resample function

i.e df=df.set_index('Date').resample("10min").mean() ## resample to 10 min for example df=df.dropna() ###Drop Nan rows print(df.index.inferred_freq)

check the print if pandas is detecting the sample you given or it will give none and try to resample again..