0
forecast = model.get_forecast(50, exog = data1[[***]].iloc[length-60:-10])

我可以为上面 *** 中的内容指定不同的名称吗?例如,如下所示。

eelement = 'open',  'high', 'low', 'volume'
forecast = model.get_forecast(50, exog = data1[[eelement]].iloc[length-60:-10])

但我得到一个错误。

if missing == len(indexer):
1297                 axis_name = self.obj._get_axis_name(axis)
-> 1298                 raise KeyError(f"None of [{key}] are in the [{axis_name}]")
1299 
1300             # We (temporarily) allow for some missing keys with .loc, except in

KeyError: "None of [Index([('open', 'high', 'low', 'volume')], dtype='object')] are in the 
[columns]"
4

1 回答 1

0

您需要将列表传递给熊猫,请尝试:

eelement = ['open',  'high', 'low', 'volume']
forecast = model.get_forecast(50, exog = data1[eelement].iloc[length-60:-10])
于 2021-12-20T10:51:40.967 回答