April 2018
Beginner to intermediate
440 pages
11h 36m
English
The Bay Area census tracts GeoJSON file has population data with polygon geometry. To create the first visualization we need to convert the geometry type to point:
tracts = gpd.read_file(r'tracts_bayarea.geojson')tracts['centroids'] = tracts.centroidtract_points = tractstract_points = tract_points.set_geometry('centroids')tract_points.plot()
The output of the previous code is as follows:
