Exploring Evictions and Code Violations in Philadelphia

In this assignment, I'll explore spatial trends evictions in Philadelphia using data from the Eviction Lab and building code violations using data from OpenDataPhilly.

I'll be exploring the idea that evictions can occur as retaliation against renters for reporting code violations. Spatial correlations between evictions and code violations from the City's Licenses and Inspections department can offer some insight into this question.

A couple of interesting background readings:

1 Explore Eviction Lab Data

The Eviction Lab built the first national database for evictions. For more information for the project, you can explore their website: https://evictionlab.org/. Understanding the evisction data will allow us to find solutions to ensure human rights, social equity, and better resource allocations.

1.1 Read data using geopandas

The first step is to read the eviction data by census tract using geopandas. The data for all of Pennsylvania by census tract can be downloaded in a GeoJSON format using the following url:


A browser-friendly version of the data is available here: https://data-downloads.evictionlab.org/

In [1]:
import numpy as np
import pandas as pd
import geopandas as gpd
import hvplot.pandas
import holoviews as hv
import cartopy.crs as ccrs
from matplotlib import pyplot as plt
%matplotlib inline