Saving the points as GeoJSON

Saving the newly cleaned GeoDataFrame is required for loading into the Mapbox CircleViz class. The GeoJSON driver must be specified, as the default output file format is shapefile:

tract_points.to_file('tract_points.geojson',driver="GeoJSON")

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.