Seeking Toyota cars with favorable MPG, horse power, rpm and price

# model, model description, combined MPG, price, horse_power, at rpm toyota_cars = """ 2018 Yaris,3-Door L 1.5-Liter 4-Cylinder 5-Speed Manual,33,15635,106,6000 2018 Yaris,3-Door LE 1.5-Liter 4-Cylinder 4-Speed Automatic,32,17285,106,6000 2018 Yaris,5-Door L 1.5-Liter 4-Cylinder 4-Speed Automatic,32,16760,106,6000 2018 Yaris iA,1.5L 4-Cylinder 6-Speed Manual,34,15950,106,6000 2018 Yaris iA,1.5L 4-Cylinder 6-Speed Automatic,35,17050,106,6000 2019 Corolla,XLE 1.8L 4-Cylinder (CVT),32,22135,132,6000 2019 Corolla,SE 1.8L 4-Cylinder (6-Speed Manual),30,21865,132,6000 2019 Corolla,XSE 1.8L 4-Cylinder (CVT),31,22880,132,6000 2019 Corolla Hatchback,SE L4 2.0L (6MT),31,19990,168,6600 2019 Corolla Hatchback,SE L4 2.0L (CVT),36,21090,168,6600 2019 Corolla Hatchback,XSE L4 2.0L (6MT),31,22990,168,6600 2018 Prius c,One 1.5L 4-Cyl. ECVT Hybrid,46,20630,73,4800 2018 Prius c,Two 1.5L 4-Cyl. ECVT Hybrid,46,21430,73,4800 2018 Prius c,Three 1.5L 4-Cyl. ECVT Hybrid,46,22855,73,4800 2018 Prius,Prius One 1.8L 4-Cyl. ECVT Hybrid,52,23475,95,5200 2018 Prius,Prius Two 1.8L 4-Cyl. ECVT Hybrid,52,24685,95,5200 2018 Prius,Prius Two Eco 1.8L 4-Cyl. ECVT Hybrid,56,25165,95,5200 2018 Camry,XSE V6 3.5-L V6 8-Speed Automatic,26,35100,301,6600 2018 Camry,L 2.5-L 4-Cylinder 8-Speed Automatic,34,23645,203,6600 2018 Camry,LE 2.5-L 4-Cylinder 8-Speed Automatic,32,24150,203,6600 2018 Camry,Hybrid LE 2.5-L 4-Cylinder ECVT Hybrid,52,27950,176,5700 2018 Camry,Hybrid SE 2.5-L 4-Cylinder ECVT Hybrid,46,29650,176,5700 2018 Camry,Hybrid XLE 2.5-L 4-Cylinder ECVT Hybrid,46,32400,176,5700 2018 Prius Prime,Plus 1.8L 4-Cyl. ECVT Hybrid,54,27300,95,5200 2018 Prius Prime,Premium 1.8L 4-Cyl. ECVT Hybrid,54,29000,95,5200 2018 Prius Prime,Advanced 1.8L 4-Cyl. ECVT Hybrid,54,33300,95,5200 2019 Avalon,XLE 3.5-Liter V6 8-Speed Automatic,26,35500,301,6600 2019 Avalon,Hybrid XLE 2.5-Liter 4-Cylinder ECVT Hybrid,44,36500,176,5700 2019 Avalon,XSE 3.5-Liter V6 8-Speed Automatic,25,38000,301,6600 2019 Avalon,Hybrid XSE 2.5-Liter 4-Cylinder ECVT Hybrid,43,39000,176,5700 2019 Avalon,Hybrid Limited 2.5-Liter 4-Cylinder ECVT Hybrid,43,42800,176,5700 2019 Toyota 86,86 2.0L 4-Cylinder 6-Speed Manual,24,26455,205,7000 2019 Toyota 86,GT 2.0L 4-Cylinder 6-Speed Manual,24,28585,205,7000 2019 Toyota 86,TRD Special Edition 2.0L 4-Cylinder 6-Speed Manual,24,32420,205,7000 2019 Sienna,LE FWD 8-Passenger 3.5L V6 Direct Shift-8AT Auto,22,33935,296,6600 2019 Sienna,SE FWD 8-Passenger 3.5L V6 Direct Shift-8AT Auto,22,37265,296,6600 2019 Sienna,XLE FWD 8-Passenger 3.5L V6 Direct Shift-8AT Auto,22,37265,296,6600 """ # The Minai model was not included due to the reliance on heavy multimedia, which made my machine unresponsive. Also, the specifications of the model were not easily accessible. import numpy as np from sklearn.preprocessing import MinMaxScaler mms = MinMaxScaler() eps = 1e16 get_top = 10 data, models = [], [] rows = toyota_cars.split(' ')[1:-1] for row in rows: model, model_description, combined_mpg, price, horse_power, at_rpm = row.split(',') combined_mpg, price, horse_power, at_rpm = list(map(float, [combined_mpg, price, horse_power, at_rpm])) models.append(', '.join([model, model_description])) data.append([combined_mpg, price, horse_power, at_rpm]) data = mms.fit_transform(np.array(data)) # We want the models to have maximum MPG and horse power at minimum price and rpm indices = (data[:,0] * data[:,2]) / (data[:,1] * data[:,3] + eps) * 10 ** 17 for i in range(get_top): max_index = np.argmax(indices) print('%.4f: "%s"' % (indices[max_index], models[max_index])) # Delete seen index models = np.delete(models, max_index, 0) indices = np.delete(indices, max_index, 0) """ 3.9861: "2018 Camry, Hybrid LE 2.5-L 4-Cylinder ECVT Hybrid" 3.1889: "2018 Camry, Hybrid SE 2.5-L 4-Cylinder ECVT Hybrid" 3.1889: "2018 Camry, Hybrid XLE 2.5-L 4-Cylinder ECVT Hybrid" 2.9231: "2019 Avalon, Hybrid XLE 2.5-Liter 4-Cylinder ECVT Hybrid" 2.7902: "2019 Avalon, Hybrid XSE 2.5-Liter 4-Cylinder ECVT Hybrid" 2.7902: "2019 Avalon, Hybrid Limited 2.5-Liter 4-Cylinder ECVT Hybrid" 2.0124: "2018 Camry, L 2.5-L 4-Cylinder 8-Speed Automatic" 1.7157: "2019 Corolla Hatchback, SE L4 2.0L (CVT)" 1.6770: "2018 Camry, LE 2.5-L 4-Cylinder 8-Speed Automatic" 1.1765: "2018 Camry, XSE V6 3.5-L V6 8-Speed Automatic" """

According to our criteria, the model "2018 Camry, Hybrid LE 2.5-L 4-Cylinder ECVT Hybrid" receives the highest score. It has the highest combined MPG and horse power relative to price and rpm.