This example illustrates how to load data from a CARTO table using a SQL Query.
Use this when you need to see or modify the data locally. If you only need to visualize the data, just use the query directly in the Layer:
Layer('SELECT * FROM dataset_name')
Note: You'll need CARTO Account credentials to reproduce this example.
In [1]:
from cartoframes.auth import set_default_credentials
set_default_credentials('cartoframes')
In [2]:
from cartoframes import read_carto
gdf = read_carto("SELECT * FROM global_power_plants WHERE country IN ('Brazil')")
gdf.head()
Out[2]:
In [3]:
from cartoframes.viz import Layer
Layer(gdf)
Out[3]: