Get startedGet started for free

Identifying Gentrifiable Tracts

In this exercise, you will identify and map the tracts that were gentrifiable in 2000. The criteria are:

  1. Low median household income (MHI), determined as tract MHI less than the MHI for the New York metro area.
  2. A low level of recent housing construction, determined as those tracts with a percentage of housing built in the previous 20 years (since 1980) less than the percentage for the New York metro area.

The GeoDataFrame bk_2000, with data for Brooklyn Census tracts in 2000, has been loaded for you.

This exercise is part of the course

Analyzing US Census Data in Python

View Course

Exercise instructions

  • Calculate a boolean column low_mhi by checking to see whether mhi is less than mhi_msa
  • Calculate a boolean column low_recent_build by checking to see whether the percentage of homes built in the 20 years prior to 2000 (pct_recent_build) is less than pct_recent_build_msa
  • Use the & operator to classify the neighborhood as gentrifiable if both low_mhi and low_recent_build are true; the columns must be surrounded by parenthesis
  • Map the gentrifiable tracts using the YlGn colormap

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Median income below MSA median income
bk_2000["low_mhi"] = ____

# Recent construction below MSA
bk_2000["low_recent_build"] = ____

# Identify gentrifiable tracts
bk_2000["gentrifiable"] = (____) & (____)

# Plot gentrifiable tracts
bk_2000.plot(column = ____, cmap = ____)
plt.show()
Edit and Run Code