Ebay Car Sale Data

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?

https://app.dataquest.io/m/294/guided-project%3A-exploring-ebay-car-sales-data/8/storing-aggregate-data-in-a-dataframe

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

1 Like

Hi @louisalau716,

Every data analyst tries to think in a different way, Just because the Dataquest solution produces those values, it doesn’t mean that they are the optimal values.

Why is that? Is is because I removed some of the data for the price column since I thought they were outliers?

Probably, that’s the case. However, that doesn’t necessarily make your answer wrong. :slightly_smiling_face: However, in these cases, you should write an explanation in the project stating why you felt that those values were outliers.

Best,
Sahil