Table.to_dataframe

Table.to_dataframe(max_results=None, *, variables=None, geography_variable="", progress=True) → pandas.DataFrame | geopandas.GeoDataFrame

Returns a representation of the table as a pandas or geopandas dataframe.

Parameters:

max_results : int, default None The maximum number of rows to return. If not specified, all rows in the table will be read.

variables : list<str>, default None A list of variable names to read, improving performance when not all variables are needed. If unspecified, all variables will be represented in the returned rows. Variable names are case-insensitive, though the names in the results will reflect the variable's true casing. The order of the columns returned will correspond to the order of names in this list.

geography_variable : str, default "" Only relevant if one of your variables is of type "geography". The variable to use as the geopandas geometry. If an empty string, the first geography variable in the dataframe will be used. If set to None, a normal pandas.DataFrame will be returned instead, with all geography variables stored as their WKT string representation.

progress : bool, default True Whether to show a progress bar.

Returns:

pandas.DataFrame | geopandas.GeoDataFrame

Notes:

The returned dataframe will use numpy dtypes for its backend. Learn more about pandas dtypes and type conversions >

Last updated

Was this helpful?