The mask method performs the exact opposite operation that the where method does. By default, it creates missing values wherever the boolean condition is True. In essence, it is literally masking, or covering up, values in your dataset.
Masking DataFrame rows
Getting ready
In this recipe, we will mask all rows of the movie dataset that were made after 2010 and then filter all the rows with missing values.
How to do it...
- Read the movie dataset, set the movie title as the index, and create the criteria:
>>> movie = pd.read_csv('data/movie.csv', index_col...