I’m working on the ebay car sale guided project and I am pretty much towards the end of the guided project but I noticed that the average price I have is different from what is displayed by the guided instructions. Why is that? Is is because I removed some of the data for the price
column since I thought they were outliers?
This is the code I used to remove the outliers:
autos['price'] = autos[autos['price'].between(0, 25500)]['price']
This is the code to find the average price for the top 6 brand:
brand_mean_prices = {}
brands = ['volkswagen', 'opel', 'bmw', 'mercedes_benz', 'audi', 'ford']
for b in brands:
mean_price = autos.loc[autos['brand'] == b, 'price'].mean()
brand_mean_prices[b] = mean_price.astype(int)
brand_mean_prices
output
{‘audi’: 7033,
‘bmw’: 6744,
‘ford’: 3336,
‘mercedes_benz’: 6613,
‘opel’: 2812,
‘volkswagen’: 4721}
Below is the answer that is on the learn part of the screen:
audi 9336
bmw 8332
ford 3749
mercedes_benz 8628
opel 2975
volkswagen 5402
dtype: int64