Hello,
This is just to verify my solution for this step. I hope someone confirms.
brand_list = {}
brands = auto['brand'].unique()
for i in brands:
selected_brands = auto[auto["brand"] == i]
sorted_rows = selected_brands.sort_values("price", ascending=False)
top_brands = sorted_rows.iloc[0]
brand_mean_price = top_brands["price"].mean()
brand_list[i] = brand_mean_price
print(brand_list)
bmp = pd.Series( brand_list)
print (bmp)
df = pd.DataFrame(bmp, columns=['price'])
df
Thank you and best regards