rents holds flat sizes and monthly rents. The last row's rent was typed with an extra zero. Fit a LinearRegression of rent on sqft with all rows and again without the last row.
Store both slopes (rent per extra square foot), rounded to 2 decimals, as [with_bad_row, without] in result.
import pandas as pd
rents = pd.DataFrame({
"sqft": [450, 600, 650, 800, 900, 1000, 1100, 1200, 1350, 1500, 700],
"rent": [9000, 12000, 13000, 16000, 18000, 20000, 22000, 24000, 27000, 30000, 140000],
})Store your final answer in a variable named result.
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.