text_html_output_1.png
from sklearn import linear_model

import pandas as pd

df = pd.read_csv('../input/used-car-dataset-ford-and-mercedes/toyota.csv')

X = df[['year', 'mileage']]
Y = df['price']

regr = linear_model.LinearRegression()
regr.fit(X.values, Y)
prediction = regr.predict([[2020, 20000]])

y_hat = regr.predict(X)
y_hat

dc = pd.concat([df[0:].reset_index(), pd.Series(y_hat, name='predicted')], axis='columns')
dc