ComeçarComece de graça

Map of tree density by district (1)

Using a dataset of all trees in public spaces in Paris, the goal is to make a map of the tree density by district. For this, we first need to find out how many trees each district contains, which we will do in this exercise. In the following exercise, we will then use this result to calculate the density and create a map.

To obtain the tree count by district, we first need to know in which district each tree is located, which we can do with a spatial join. Then, using the result of the spatial join, we will calculate the number of trees located in each district using the pandas 'group-by' functionality.

GeoPandas has been imported as geopandas.

Este exercício faz parte do curso

Working with Geospatial Data in Python

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Read the trees and districts data
trees = ____
districts = ____

# The trees dataset with point locations of trees
print(trees.head())
Editar e executar o código