Session Ready
Exercise

Which city gets the most snow?

The Dask DataFrame weather from the previous exercise is provided here.

Your task now is to aggregate the total snow fall for each airport (at least those airports that experienced snow). You'll use the method .str.contains() to create a boolean Series identifying snowy days. You'll need to chain with the method fillna(False) as well; this is to clean NaN values from the boolean Series so it can be used for selection within the .loc[] accessor. After filtering rows that correspond to snowy days from weather, you'll group the rows of the filtered DataFrame by airport code. This allows you to extract the precipitation column and compute aggregated sums grouped by airport.

Instructions 1/4
undefined XP
  • 1
  • 2
  • 3
  • 4

Create a boolean array is_snowy from the 'Events' column of weather. Apply the method .str.contains() to find rows containing 'Snow' and chain a call to fillna(False) to replace NaN values with False.