def forecastZip(zip):
zillowByZip = zillowUSAyears.loc[zillowUSAyears['RegionName']==zip]
house_model = Prophet(interval_width=0.95)
house_model.fit(zillowByZip)
future_dates = house_model.make_future_dataframe(periods=1, freq='Y')
forecast = house_model.predict(future_dates)
forecast_data = forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']]
print (forecast_data)
zillowUSAyears["RegionName"].map(forecastZip)
Вывод
ds yhat yhat_lower yhat_upper
0 1997-01-01 220457.195528 180555.431476 262134.733182
1 1998-01-01 224642.140135 182340.989352 266208.65300 266208.653005
2 1999-01-01 228718.025457 186095.628003 267836.459491
Но когда я использую возврат вместо печати, я получаю это ...
Год
1997-01- 01 00:00:00 ds yhat yhat_lower ...
1998-01-01 00:00:00 ds yhat yhat_lower ...
1999-01-01 00:00:00 ds yhat yhat_lower ...