Load data from a CARTO Table

This example illustrates how to load data from a CARTO table.

Use this when you need to see or modify the data locally. If you only need to visualize the data, just use the name of the dataset in the Layer: Layer('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('global_power_plants', limit=100)
gdf.head()


Out[2]:
cartodb_id the_geom fuel4 country_abbrev country name gppd_idnr capacity_mw latitude longitude ... owner source url geolocation_source year_of_capacity_data generation_gwh_2013 generation_gwh_2014 generation_gwh_2015 generation_gwh_2016 estimated_generation_gwh
0 8465 POINT (10.84410 48.58820) DEU Germany Nordendorf Solar Power Plant WRI1030340 7.4 48.5882 10.8441 ... Sinosol AG http://www.sinosol.de Industry About NaN NaN NaN NaN 68.537617
1 8410 POINT (11.20140 48.32320) DEU Germany Miegersbach Solar Power Plant WRI1030364 5.2 48.3232 11.2014 ... Phoenix Solar AG http://www.phoenixsolar-group.com Industry About NaN NaN NaN NaN 48.161569
2 11314 POINT (14.50530 -22.95750) NAM Namibia Anixas WRI1023132 24.3 -22.9575 14.5053 ... African Development Bank Group http://powerafrica.opendataforafrica.org Power Africa NaN NaN NaN NaN 5.273790
3 25385 POINT (-70.09890 8.83630) VEN Venezuela Masparro WRI1018659 25.0 8.8363 -70.0989 ... Venezuela Electricity Sector http://www.mppee.gob.ve/download/anuario_estad... GEODB NaN 165.0 NaN NaN 123.392392
4 13042 POINT (126.51120 34.40910) KOR South Korea Gochang WRI1029915 15.0 34.4091 126.5112 ... CDM https://cdm.unfccc.int/Projects/DB/KEMCO125427... WRI NaN NaN NaN NaN 405.443975

5 rows × 24 columns


In [3]:
from cartoframes.viz import Layer

Layer(gdf)


Out[3]:
:
StackTrace
    ">