Challenge 17 Megathread

For any and all questions relating to Challenge 17 :point_down: post away!

Awesome exercise.
For people who do not know other groupby functions well.
Here is the hint, click_me.
Good luck, everyone. Cheers.


When I see: " What were the two most popular Toyota vehicle categories in 2020?",
I think: “Which were the highest selling categories, where vehicle Model Year is 2020?”
…and this would be grossly overthinking the question :joy::sweat_smile:


Hello everyone, welcome to day 17 challenge!!! :dancer::dancer::dancer:.

Kindly ask questions here and discuss amongst yourselves without sharing answers.

Thank you.

Thank you @amaturecoder!

If this isn’t inappropriate, can anyone tell me why df_new = df.grouby(,…) ends up making df_new a function? That is throwing me off completely.

Shouldn’t be a new function, you’re describing a variable here in your code example.

The debugger was calling it a ‘function’ so I figured that was what it was. No matter now. I’m done.
Thanks though!

Hi all, I will be moderating the forum for the next 2 hours. Please let me know if you face any barriers in attempting to complete todays challenge. Also, please remember to not share any answers on this forum.


You were not the only one, my friend. I always thought that “Most Popular” meant “Best Selling” in this context.

Sorry - can I post my code and ask a question about it? I feel like most the posts are intentionally general (maybe no sharing code?)

Is there a way to post with just the moderator seeing it? Thanks!

Hi @sunshine221, @Kelvine95 confirmed in the discussion for Challenge 18 (see comment here) that we can’t share code on the forum.

But maybe you can DM Kelvine95?


Then again, people have shared small snippets of their code, and the moderators have been okay with that. For example, the below is a comment from someone else:

i did

Seasons = ['summer','winter']
FilteredSeasons = df['season'].isin(Seasons)

uses the .isin() and .loc()

And the below comment is a moderator’s response to the above comment:

This is good. Optimizing for memory:


Edit 2:

Sharing Small Snippets Is Ok
Kelvine95 confirmed here that small snippets are ok.

You Can DM The Moderators
Kelvine95 confirmed here you can DM the moderators if you need help with larger pieces of code.