pycon-pandas-tutorial icon indicating copy to clipboard operation
pycon-pandas-tutorial copied to clipboard

Exercise 1 - Treasure Island movies question

Open richardguinness opened this issue 3 years ago • 1 comments

Hi Brandon,

Thanks for an excellent tutorial.

Your answer to q "List all of the "Treasure Island" movies from earliest to most recent." is titles[titles.title == 'Treasure Island'].sort_values('year')

There are a few Treasure Island movies (e.g. Treasure Island (II) ) which will not make it through this filter.

This could be addressed by changing the answer to the following: titles[titles.title.str.startswith('Treasure Island')].sort_values('year')

Or perhaps the question is a little ambiguous.

All the best,

Richard

richardguinness avatar Jun 14 '21 15:06 richardguinness

Interesting! I hadn't considered multiple Treasure Islands released in the same year. It might be a while before I return to this repository to re-run its notebooks, but when I do, I'll see about getting the solution updated to something like what you recommend here. Thanks for suggesting this improvement!

brandon-rhodes avatar Jun 24 '21 13:06 brandon-rhodes