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

dataframe can not plot #148

Open f5-ansible opened 1 year ago

f5-ansible commented 1 year ago

run my code as doc write, nothing happen in win or mac:

import pandas as pd import matplotlib.pyplot as plt import numpy as np from adtk.data import validate_series from adtk.visualization import plot from adtk.transformer import RollingAggregate from adtk.transformer import DoubleRollingAggregate from adtk.detector import ThresholdAD

dt1 = pd.date_range(start="20190101", end="20190831", freq="D")

dt2 = pd.date_range(start="20190101", periods=10, freq="10D") df2 = pd.DataFrame(np.arange(20).reshape((10, 2)), index=dt2,columns=['A','B']) print(df2)

print(df2.index)

df2 = validate_series(df2) plot(df2)

f5-ansible commented 1 year ago

version 0.6.2

TonyEinstein commented 9 months ago

I encountered the same problem, and I reported an error. How to solve this problem temporarily?

My question link: ValueError: Multi-dimensional indexing (e.g. obj[:, None]) is no longer supported. Convert to a numpy array before indexing instead.

TonyEinstein commented 9 months ago

In the file of https://github.com/arundo/adtk/blob/v0.6.2/tests/test_visualization.ipynb, The example does not use df, does it mean it does not support df?