I was doing machine learning basics playlist and this error kept showing KeyError: "None of [Index(['area'], dtype='object')] are in the [columns]"

Viewed 18

this is my code which keeps showing error

model = linear_model.LinearRegression() model.fit(df[['area']],df.price)

I have tried using df.columns = df.columns.str.replace(' ', '') but it made no difference

0 Answers
Related