October 2017
Intermediate to advanced
532 pages
16h 10m
English
After reading in our data, we decide not to include the 2017 September data, as it is not quite a complete month. We use a partial date string to slice all the way up to and including any crimes in August of 2017. In step 4, we tally all the crimes for each offense category per month, and in step 5, we sort by this total, which is required for merge_asof.
In step 6, we select the most recent data into a separate DataFrame. We will use this month of August as our baseline and create a column, Total_Goal, that is 20% less than the current. In step 7, we use merge_asof to find the last time a monthly crime count was less than the Total_Goal column.
Read now
Unlock full access