Creating the dataset

The first step is to create a dataset, if you haven't created it already. This code generates an empty dataset in the account, which will have a name and description as provided to the datasets.create method:

from mapbox import Datasetsimport jsondatasets = Datasets(access_token={secrettoken})create_resp = datasets.create(name="Bay Area Zips",               description = "ZTCA zones for the Bay Area")

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.