Skip to content

GeoDataFrame

Constructor

geopolars.GeoDataFrame

Bases: pl.DataFrame

get_column

get_column(name: str) -> pl.Series | GeoSeries

Get a single column as Series or GeoSeries by name.

Return GeoSeries if requested column is geometry column.

Parameters:

  • name (str) –

    Name of the column to retrieve.

Returns:

  • pl.Series | GeoSeries

    A column of the DataFrame as either a polars Series or a GeoSeries.

Examples:

>>> df = pl.DataFrame({"foo": [1, 2, 3], "bar": [4, 5, 6]})
>>> df.get_column("foo")
shape: (3,)
Series: 'foo' [i64]
[
        1
        2
        3
]