Yaping Lang
09/04/2023, 7:37 AMTraceback (most recent call last):
File "/Users/lilypad/Documents/Code/timegpt/test1.py", line 19, in <module>
sf.plot(df, fcst_df, level=[80, 90], max_insample_length=24 * 5)
File "/opt/homebrew/lib/python3.11/site-packages/statsforecast/core.py", line 1789, in plot
axes[idx, idy].fill_between(
File "/opt/homebrew/lib/python3.11/site-packages/matplotlib/__init__.py", line 1446, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 5425, in fill_between
return self._fill_between_x_or_y(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 5330, in _fill_between_x_or_y
ind, dep1, dep2 = map(
^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/numpy/ma/core.py", line 2360, in masked_invalid
return masked_where(~(np.isfinite(getdata(a))), a, copy=copy)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
python script is :
import pandas as pd
import os
from nixtlats import TimeGPT
from statsforecast import StatsForecast as sf
print(os.environ)
df = pd.read_csv('<https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short.csv>')
timegpt = TimeGPT(token=os.environ['TIMEGPT_TOKEN'])
fcst_df = timegpt.forecast(df, h=24, level=[80, 90])
print("NaN count in df:")
print(df.isna().sum())
print("NaN count in fcst_df:")
print(fcst_df.isna().sum())
sf.plot(df, fcst_df, level=[80, 90], max_insample_length=24 * 5)
José Morales
09/04/2023, 3:54 PMfcst_df.dtypes
)?. I think the level columns may not be numericalMax (Nixtla)
09/04/2023, 9:18 PM{
"status": 429,
"data": null,
"message": "Too many requests",
"details": "You have reached your request limit, top up your credits to continue using the API",
"code": "A20",
"requestID": ""
}
If you haven't yet. Could you please fill out the form on our Website so we can process it? Just click on Submit interest on https://www.nixtla.io/Yaping Lang
09/06/2023, 3:13 AMunique_id object
ds object
TimeGPT float64
TimeGPT-lo-90 float64
TimeGPT-lo-80 float64
TimeGPT-hi-80 float64
TimeGPT-hi-90 float64
dtype: object
José Morales
09/06/2023, 10:34 PMpip install utilsforecast
) and using:
from utilsforecast.plotting import plot_series
plot_series(df, fcst_df, level=[80, 90], max_insample_length=24 * 5)
It'd help us because we're going to replace the statsforecast function with that one and it'd be better to fix the error there if we find one