LoslegenKostenlos loslegen

Calculating a normalized metric

Now you are ready to divide the number of building permits issued for projects in each council district by the area of that district to get a normalized value for the permits issued. First you will verify that the districts_and_permits is still a GeoDataFrame.

Diese Übung ist Teil des Kurses

Visualizing Geospatial Data in Python

Kurs anzeigen

Anleitung zur Übung

  • Print the type() of districts_and_permits.
  • Add one more column to districts_and_permits. Use a lambda expression and the pandas apply() method to divide the number of building permits issued for projects in each council district by the area of that district to get a normalized value for the permits issued.
  • Print the first five rows of districts_and_permits.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Print the type of districts_and_permits
print(____(____))

# Create permit_density column in districts_and_permits
districts_and_permits['permit_density'] = districts_and_permits.apply(lambda row: row._____ / row._____, axis = 1)

# Print the head of districts_and_permits
print(____.____())
Code bearbeiten und ausführen