Date: March 28
Company: Georgia Institute of Technology
Contact: Sarkari, Zenobia <
zsarkari3@gatech.edu>
Hi Team,
I am trying to familiarize myself with TimeGPT, however, am struggling. Seems to be a different error each time I fix the current one.
I attached the small csv file I am using as well as the script. Not sure what I am doing wrong.
CSV attached
Code:
import pandas as pd
from nixtlats import TimeGPT
timegpt = TimeGPT(
token='8MzlyaOo7N0uS0Hk71Kt7vHiTg3rQ6CAZ5yF2B15h67dVFK4udDjilMx1fZwnLkgwEy8vwFle9ne7UH4n6jDSn9kE5JfbalB7GWszQ8AJtieByjMukHEp6MhqmfyWH8C6XP2GZHg9ncgE5ZtkYVlTc5ZXP97wqpIDDCUZ5vgVH35N0M7HCR56IbexLZZJhuMDAshv3lXpl5Uy7A2q0qsYOGo1yAXqcvGgnHVcgDbMAz6tRBRRlecdatfeJlN0fVt'
)
_*df = pd.read_csv(r'C:\Users\Zenobia\Documents\a_updated.csv')*_
# # Convert 'PercentChange' column to numeric, coerce errors to NaN
_*# df['PercentChange'] =
pd.to_numeric(df['PercentChange'], errors='coerce')*_
# # Drop rows with NaN values in 'PercentChange' column
# df.dropna(subset=['PercentChange'], inplace=True)
df.head()
# Forecast
_*timegpt.plot(df, time_col='Timestamp', target_col='Close') # Good for report*_
_*timegpt_fcst_df = timegpt.forecast(df=df, h=12, freq='MS', time_col='Timestamp', target_col='Close')*_
_*timegpt_fcst_df.head() # No error here*_