Error on loading the target variable

hey guys,
any advice?
inputs_df = prices_df[input_cols].copy()
targets = prices_df[target_col]

KeyError Traceback (most recent call last)

in () ----> 1 targets = prices_df[target_col]

2 frames

/usr/local/lib/python3.7/dist-packages/pandas/core/indexing.py in _validate_read_indexer(self, key, indexer, axis, raise_missing) 1296 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 [Int64Index([208500, 181500, 223500, 140000, 250000, 143000, 307000, 200000,\n 129900, 118000,\n …\n 136000, 287090, 145000, 84500, 185000, 175000, 210000, 266500,\n 142125, 147500],\n dtype=‘int64’, length=1460)] are in the [columns]”

target_col should be a string representing the target column name.

but isn’t it a numerical variable?

The column itself contains values which are numbers.

The target column name is a different thing. It’s used to pinpoint which column acts as a target.