5.1. Exercises
Filtering Question
Question 1
If the output of
df['location'] == 'Canada'is
[True, False, False, True]
What would be the output of
~(df['location'] == 'Canada')Coding questiongs
Instructions:
Running a coding exercise for the first time, could take a bit of time for everything to load. Be patient, it could take a few minutes.
When you see ____ in a coding exercise, replace it with what you assume to be the correct code. Run it and see if you obtain the desired output. Submit your code to validate if you were correct.
Single Condition Filtering
Try to filter the dataframe to obtain only a certain Pokemon type using single condition filtering.
Tasks:
- Create a new dataframe named
fire_pokemoncontaining only the rows oftype“fire”.
Filtering using “and”
Let’s find all the pokemon that meet multiple conditions.
Tasks:
- Filter the dataframe for the pokemon that have
attackanddefensevalues both greater than 100. - Save this dataframe as an object named
mighty_pokemon.