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

Can I specify a different name for what I put in *** above? For example, like below.

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

But I get an error.

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]"

1 Answers1

0

You need to pass a list to pandas, try:

eelement = ['open',  'high', 'low', 'volume']
forecast = model.get_forecast(50, exog = data1[eelement].iloc[length-60:-10])
Arne Decker
  • 808
  • 1
  • 3
  • 9