Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] nab.py error line 87: converting np.int64 #155

Open
ravenrip opened this issue May 19, 2023 · 2 comments
Open

[BUG] nab.py error line 87: converting np.int64 #155

ravenrip opened this issue May 19, 2023 · 2 comments

Comments

@ravenrip
Copy link

Describe the bug
Following the Tutorial (A Gentle Introduction to Anomaly Detection in Merlion, I receive the following error:
84 df = df.drop_duplicates(subset="timestamp", keep="first")
85 logger.warning(f"Time series {csv} (index {i}) has timestamp duplicates. Kept first values.")
---> 87 all_dt = np.unique(np.diff(df["timestamp"])).astype(np.int64)
88 gcd_dt = all_dt[0]
89 for dt in all_dt[1:]:

TypeError: int() argument must be a string, a bytes-like object or a real number, not 'Timedelta'

To Reproduce
Perform the first step in the tutorial on Anomaly Detection

Expected behavior
Receive a train & test dataset

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows 11
  • Merlion Version: Main code branch

Additional context
Fixed the issue by changing line 87 in nab.py
FROM:
all_dt = np.unique(np.diff(df["timestamp"])).astype(np.int64)

TO:
all_dt = np.unique(np.diff(df["timestamp"]))

@akramsalim
Copy link

Hi, I'm facing the same issue and did change the line 87 in nab.py as you described. However, i still have the same issue. Did you do something else after change the line 87 in nab.py?
I appreciate your answer.

@rajab1691
Copy link

It's working, just restart the notebook and again import Merlion and run all the cell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants