Incorrect top 20 price values

Screen Link:

My Code:

autos.loc[:,"price"].value_counts().sort_index(ascending=False).head(20)

What I expected to happen:

99999999 1
27322222 1
12345678 3
11111111 2
10000000 1
3890000 1
1300000 1
1234566 1
999999 2
999990 1
350000 1
345000 1
299000 1
295000 1
265000 1
259000 1
250000 1
220000 1
198000 1
197000 1
Name: price, dtype: int64

What actually happened:

99999999 1
999999 2
999990 1
9999 131
9998 2
9995 5
99900 2
9990 84
999 434
9989 1
9980 10
998 5
9975 2
9970 1
996 1
9950 32
995 5
99000 2
9900 135
990 147
Name: price, dtype: int64

Replace this line with the output/error

This is for the Guided Project: Exploring Ebay Car Sales Data. Why am I not getting the same top 20 price values as in the solutions? Please help.I’m so stuck!

Thanks

Hello,

Your code is correct. The problem must be in some manipulation you did before reaching this point. Could you share the notebook so people can look into it?

Hello,

Thank you for your reply. How do I share my notebook?

Thank you

Please refer this post -

1 Like