Scale sqft and rent with StandardScaler and run KMeans(n_clusters=2, n_init=10, random_state=0) twice: on all rows, and on the rows without the last (bad) one.
Store the cluster sizes of each run, sorted from smallest to largest, as [[sizes with the bad row], [sizes 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.