Query.to_dataframe

This method is deprecated, in favor of the more explicit Query.to_pandas_dataframe and Query.to_geopandas_dataframe methods.

Note that the new methods use the "pyarrow" dtype backend by default, while the deprecated to_dataframe method uses "numpy" dtypes. While most code will be unaffected, if you rely on numpy datatypes, you can call to_pandas_dataframe(dtype_backend="numpy") to replicate the behavior of this method. Learn more >

Query.to_dataframe(max_results=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 query results will be read.

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