> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/api/client-libraries/redivis-python/reference/table/table.to_geopandas_dataframe.md).

# Table.to\_geopandas\_dataframe

### Table.<mark style="color:purple;">to\_geopandas\_dataframe</mark>(*max\_results=None, \*, variables=None, geography\_variable=None, progress=True, batch\_preprocessor=None, dtype\_backend="pyarrow", date\_as\_object=False,* max\_parallelization=os.cpu\_count()) → [geopandas.GeoDataFrame](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html)

Returns a representation of the table as a GeoPandas dataframe. The table must contain at least one geography variable, otherwise an error will be thrown.

{% hint style="info" %}
Also callable on [Queries](/api/client-libraries/redivis-python/reference/query.md) and [Uploads](/api/client-libraries/redivis-python/reference/upload.md) →  

`query.to_geopandas_dataframe(...)` | `upload.to_geopandas_dataframe(...)`
{% endhint %}

### **Parameters:**&#x20;

**`max_results` :&#x20;*****int, default None*** \
The maximum number of rows to return. If not specified, all rows in the table will be read.&#x20;

**`variables` :&#x20;*****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` :&#x20;*****str, default None***\
The variable to use as the geopandas geometry. If set to `None`, the first geography variable in the table will be used.

**`progress` :&#x20;*****bool, default True***\
Whether to show a progress ba&#x72;**.**&#x20;

**`batch_preprocessor` :&#x20;*****function, default None***\
Function used to preprocess the data, invoked for each batch of records as they are initially loaded. This can be helpful in reducing the size of the data before being loaded into a dataframe. The function accepts one argument, a [`pyarrow.RecordBatch`](https://arrow.apache.org/docs/python/generated/pyarrow.RecordBatch.html), and must return a `pyarrow.RecordBatch` or `None`. If you prefer to work with the data solely in a streaming manner, see [`Table.to_arrow_batch_iterator()`](/api/client-libraries/redivis-python/reference/table/table.to_arrow_batch_iterator.md)

**`dtype_backend` :&#x20;*****{"pyarrow","numpy","numpy\_nullable"}, default "pyarrow"***\
The data type backend to use for the dataframe. [PyArrow is a new datatype available in pandas 2.0](https://pandas.pydata.org/docs/user_guide/pyarrow.html), which offers substantially improved performance and memory efficiency, alongside straightforward type mapping to the data in Redivis. Pyarrow dtypes will work with most existing code, and can be converted to numpy dtypes as needed. If you prefer to work with numpy dtypes, consult the [pandas data type conversion documentation](/api/client-libraries/redivis-python/reference.md#pandas-datatype-conversions) to learn how Redivis types are mapped to numpy.

**`date_as_object` :&#x20;*****bool, default False***\
Whether variables of Redivis type `date` should be expressed as `datetime.date` objects, rather than the default `np.datetime64[ns]`. Only relevant for `"numpy"|"numpy_nullable"` dtype\_backends. [Learn more >](/api/client-libraries/redivis-python/reference.md#pandas-datatype-conversions)

**`max_parallelization` :&#x20;*****int, default os.cpu\_count()***\
The maximum number of threads utilized when loading the table.

### **Returns:**&#x20;

[**geopandas.GeoDataFrame**](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html)

{% hint style="success" %}
**See also**

* [Table.to\_arrow\_batch\_iterator()](/api/client-libraries/redivis-python/reference/table/table.to_arrow_batch_iterator.md)
* [Table.to\_arrow\_dataset()](/api/client-libraries/redivis-python/reference/table/table.to_arrow_dataset.md)
* [Table.to\_arrow\_table()](/api/client-libraries/redivis-python/reference/table/table.to_arrow_table.md)
* [Table.to\_pandas\_dataframe()](/api/client-libraries/redivis-python/reference/table/table.to_pandas_dataframe.md)
* [Table.to\_dask\_dataframe()](/api/client-libraries/redivis-python/reference/table/table.to_dask_dataframe.md)
* [Table.to\_polars\_lazyframe()](/api/client-libraries/redivis-python/reference/table/table.to_polars_lazyframe.md)
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.redivis.com/api/client-libraries/redivis-python/reference/table/table.to_geopandas_dataframe.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
