Week 6 of Civic Analytics with ArcGIS Hub (visualizing patterns)

09-29-2020 02:22 PM
Esri Contributor

This week we explore how charting libraries in Python can help us visualize temporal and spatial patterns to get a quick snapshot of our city. For this, we look at the crime data in Washington, DC as well as 311 service requests from the year 2019 in two separate notebooks. We start by extracting the month, hour and day of the week for each record from the timestamp field. We plot these on histograms to observe a quick visual of which months/hours/days have most number of recorded criminal incidents and 311 calls. This helps us identify the time periods of high and low activity.

We create small multiple charts for criminal incidents based on the SHIFT of the day they were reported in, i.e. day, evening or midnight. We then proceed to create these charts for offense type, to get a sense of density and spread of these incidents based on offense type.

For 311 calls, we plot small multiple horizontal bar charts to summarize the most frequent category of requests for each Ward (administrative boundary) of Washington, DC along with a chart of small multiple maps for the agency most calls are routed to. Using these small multiple charts and maps we can compare how spatial patterns differ within the city, to understand sub-spatial nuances better.


We conclude with a statistical analysis that evaluates if number of crimes (or 311 calls) reported in each census tract of a neighborhood, correlate with the population of those census tracts. The steps followed are:

  • Enrich the most recent census tracts layer for Washington, DC with recent population data.
  • Join the neighborhoods layer to this data spatially (based on location of the two), in order to get the appropriate neighborhood(s) that each census tract falls within.
  • Compute a Pearson correlation coefficient for the number of crimes (or 311 calls) reported and population for each census tract of a neighborhood.

Links to notebooks –

  1. Temporal, Spatial and Statistical patterns in civic (crime) data
  2. Temporal, Spatial and Statistical patterns in civic (311 service requests) data

Accompanying blogpost

0 Kudos
0 Replies