-
Notifications
You must be signed in to change notification settings - Fork 201
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
'Series' object has no attribute 'ds'. Did you mean: 'xs' #208
Comments
你好,我也遇到了这个问题,想问下您解决这个问题了么,如何解决的呢 |
Hi @Yag-ger and @grace001214. I was not able to replicate this problem, but I think it might be a column naming issue. Could you please rename the timestamp column and let me know if the problem is still persistent? |
I think there's a bug here Lines 193 to 206 in 7ceb253
If the name of the index is |
I agree with you, we will see this issue anytime the date col is passed as index, (even though it might be named 'ds'). For instance, I was able to replicate the issue with the following data: I think it might be helpful to add something like:
|
Student & first GitHub Post ever. I hope this is the right issue in the right place. Feel free to move this post.
I am using Nixtlats TimeGPT in Python and I already created a token on the website. The token also works, the validation function gives back true. Upon calling the function detect_anomalies on a simple timeseries the following error is shown:
AttributeError: 'Series' object has no attribute 'ds'. Did you mean: 'xs'?
I tried to find a solution in the docs but couldnt find any. I also tried to rename my date column to ds. Still no Luck.
Logs:
outliers_timegpt = timegpt.detect_anomalies(timeseries, time_col='ds', target_col='prognosebasis', freq='W')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ygerkman\AppData\Local\miniconda3\Lib\site-packages\nixtlats\timegpt.py", line 1190, in detect_anomalies
return self._detect_anomalies(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ygerkman\AppData\Local\miniconda3\Lib\site-packages\nixtlats\timegpt.py", line 625, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ygerkman\AppData\Local\miniconda3\Lib\site-packages\nixtlats\timegpt.py", line 643, in wrapper
return func(self, **kwargs, num_partitions=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ygerkman\AppData\Local\miniconda3\Lib\site-packages\nixtlats\timegpt.py", line 818, in _detect_anomalies
anomalies_df = timegpt_model.detect_anomalies(df=df)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ygerkman\AppData\Local\miniconda3\Lib\site-packages\nixtlats\timegpt.py", line 527, in detect_anomalies
df, _ = self.transform_inputs(df=df, X_df=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ygerkman\AppData\Local\miniconda3\Lib\site-packages\nixtlats\timegpt.py", line 188, in transform_inputs
if df.dtypes.ds != "object":
^^^^^^^^^^^^
File "C:\Users\ygerkman\AppData\Local\miniconda3\Lib\site-packages\pandas\core\generic.py", line 5902, in getattr
return object.getattribute(self, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Series' object has no attribute 'ds'. Did you mean: 'xs'?
The text was updated successfully, but these errors were encountered: