Same result with "value_counts(sort = False)" 285-3

I get the same result as the exercice with the argument sort=False in the value_counts function :
wnba['Age'].value_counts(sort = False)

Is there a hidden difference with the more extensive answer given by the answer :
wnba['Height'].value_counts().sort_index(ascending = False)

Thanks for your expertise :slight_smile:

Hi @ant1.meyniel,

Here is a good answer to your question. So, let’s say, it’s just a coincidence that the results of your 2 pieces of code are the same :slightly_smiling_face:

1 Like

Hey @ant1.meyniel,

This could be just a coincidence as value_counts(sort=False) will sort the series based on the frequency of index, while sort_index(ascending = False) will sort the series based on the index, so these are not the same!!

Hope it helps!!

And please include the mission link while posting questions for getting accurate answers!!

@jenil2452000 @ant1.meyniel I have formatted your code accordingly. Kindly adhere to the community guidelines here in future. Thanks!

@ant1.meyniel: Kindly also provide a question link.