From 986bd748e253a6d495e09a06ae23f83c36e33de3 Mon Sep 17 00:00:00 2001 From: Michelle Ho Date: Fri, 8 Sep 2017 15:41:19 -0400 Subject: [PATCH] adding documention on encode/decode --- cartoframes/context.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cartoframes/context.py b/cartoframes/context.py index d1f0d9a14..495966059 100644 --- a/cartoframes/context.py +++ b/cartoframes/context.py @@ -114,6 +114,11 @@ def read(self, table_name, limit=None, index='cartodb_id', limit (int, optional): Read only ``limit`` lines from ``table_name``. Defaults to `None`, which reads the full table. index (str, optional): Not currently in use. + decode_geom (bool, optional): Defaults to `False`, which reads the + table into a pandas DataFrame as is. If `True`, reads table into + a pandas DataFrame with wkb geometries found in column + `the_geom` decoded as shapely geometries in column named + `geometry`. Returns: pandas.DataFrame: DataFrame representation of `table_name` from @@ -464,11 +469,14 @@ def query(self, query, table_name=None, decode_geom=False): table_name (str, optional): If set, this will create a new table in the user's CARTO account that is the result of the query. Defaults to None (no table created). + decode_geom (bool, optional): Defaults to `False`, which does not + decode geometries. If set to `True`, this will decode wkb + geometries into shapely geometries. Returns: pandas.DataFrame: DataFrame representation of query supplied. Pandas data types are inferred from PostgreSQL data types. - In the case of PostgreSQL date types, the data type 'object' is - used. + In the case of invalid PostgreSQL date types, the data type 'object' + is used. """ self._debug_print(query=query) if table_name: