Chapter 9 - Key Error

Hello,

Can anybody please coach me through why I’m getting a key error (see image)?

I ran print(df.columns.tolist()) but there is no variable called ‘SalePrice’

Any suggestions, please?

Cheers.

SalePrice(dep_var) is the target variable. It should be present in the dataframe passed to TabularPandas (for train and valid). Hence the error.

The information in screenshot is not enough to say why SalePrice is not in your df. Need to see how df is being created.

Rightho, thanks. I’ll take another look.

Cheers.