Skip to Content
Mastering Geospatial Analysis with Python
book

Mastering Geospatial Analysis with Python

by Silas Toms, Paul Crickard, Eric van Rees
April 2018
Beginner to intermediate content levelBeginner to intermediate
440 pages
11h 36m
English
Packt Publishing
Content preview from Mastering Geospatial Analysis with Python

Accessing a dataset

To access the NBA arenas dataset that we loaded into the account, we are going to use the CartoContext read method, passing the name of the dataset we want to interact with as a string. In a Jupyter Notebook In section, run the following code:

import cartoframesAPIKEY = "{YOUR API KEY}"cc = cartoframes.CartoContext(base_url='https://{username}.carto.com/', api_key=APIKEY)df = cc.read('arenas_nba')print(df)

Using CartoContext, the account is accessed. With the cc object, the read method creates a DataFrame object from the NBA arenas dataset. The DataFrame object is what is queried or updated.

The print statement will produce a table with values from the NBA arenas dataset, which has been loaded into a CARTOframe object: ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Geospatial Analysis with Python

Learning Geospatial Analysis with Python

Joel Lawhead

Publisher Resources

ISBN: 9781788293334Supplemental Content