Skip to content

Commit

Permalink
Update nab.py (#167)
Browse files Browse the repository at this point in the history
#line 87 gives TypeError: int() argument must be a string, a bytes-like object or a real number, not 'Timedelta'.

Co-authored-by: Tian Lan <[email protected]>
  • Loading branch information
IMRO832000 and Emerald01 authored Jun 20, 2024
1 parent 032ae63 commit 085ef8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ts_datasets/ts_datasets/anomaly/nab.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def __init__(self, subset="all", rootdir=None):
if len(df["timestamp"][df["timestamp"].diff() == datetime.timedelta(0)]) != 0:
df = df.drop_duplicates(subset="timestamp", keep="first")
logger.warning(f"Time series {csv} (index {i}) has timestamp duplicates. Kept first values.")

all_dt = np.unique(np.diff(df["timestamp"])).astype(np.int64)
all_dt = np.unique(np.diff(df["timestamp"]))
gcd_dt = all_dt[0]
for dt in all_dt[1:]:
gcd_dt = np.gcd(gcd_dt, dt)
Expand Down

0 comments on commit 085ef8a

Please sign in to comment.