How to solve this error


KeyError Traceback (most recent call last)
in
----> 1 prices_df[input_cols]

/opt/conda/lib/python3.9/site-packages/pandas/core/frame.py in getitem(self, key)
3028 if is_iterator(key):
3029 key = list(key)
→ 3030 indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
3031
3032 # take() does not accept boolean indexers

/opt/conda/lib/python3.9/site-packages/pandas/core/indexing.py in _get_listlike_indexer(self, key, axis, raise_missing)
1264 keyarr, indexer, new_indexer = ax._reindex_non_unique(keyarr)
1265
→ 1266 self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing)
1267 return keyarr, indexer
1268

/opt/conda/lib/python3.9/site-packages/pandas/core/indexing.py in _validate_read_indexer(self, key, indexer, axis, raise_missing)
1306 if missing == len(indexer):
1307 axis_name = self.obj._get_axis_name(axis)
→ 1308 raise KeyError(f"None of [{key}] are in the [{axis_name}]")
1309
1310 ax = self.obj._get_axis(axis)

KeyError: “None of [Int64Index([80], dtype=‘int64’)] are in the [columns]”

It seems the input_cols is wrong. input_cols should be a list of column names representing the inputs for the model.