> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GeoSeries.fillna

> Fill NA values with geometry (or geometries).

Fill NA values with geometry (or geometries).

## Signature

```python theme={"system"}
fillna(
    value=None,
    inplace: bool = False,
    limit=None,
    **kwargs,
) -> Union[GeoSeries, None]
```

## Parameters

<ParamField path="value" type="shapely geometry or GeoSeries" default="None">
  If None is passed, NA values will be filled with GEOMETRYCOLLECTION EMPTY.
  If a shapely geometry object is passed, it will be
  used to fill all missing values. If a `GeoSeries`
  is passed, missing values will be filled based on the corresponding index
  locations. If pd.NA or np.nan are passed, values will be filled with
  `None` (not GEOMETRYCOLLECTION EMPTY).
</ParamField>

<ParamField path="inplace" type="bool" default="False" />

<ParamField path="limit" type="int" default="None">
  This is the maximum number of entries along the entire axis
  where NaNs will be filled. Must be greater than 0 if not None.
</ParamField>

<ParamField path="kwargs" />

## Returns

<ResponseField name="return" type="GeoSeries" />

<Note>
  Index alignment with another `GeoSeries` is lazy. Invalid duplicate
  replacement indexes raise a Spark error when the result is evaluated,
  rather than a Python `ValueError` when calling `fillna`. This also
  applies to `inplace=True`. A query that skips evaluating the result may
  skip this validation.

  On Spark 3.5.0--3.5.3, evaluating the same failed result again can hang
  with adaptive query execution enabled (SPARK-49979). This also affects
  failed `inplace=True` results. Use Spark 3.5.4 or newer to avoid this
  upstream issue.

  Sharing the alignment relies on `spark.sql.exchange.reuse=true` (the
  default). Disabling it can execute the alignment four times instead of
  once. Validation does not force a broadcast; normal Spark broadcast
  settings still apply to the separate label join.

  Using `limit` requires distributed global ordering and can be expensive
  for large GeoSeries.
</Note>

**See also**

* `GeoSeries.isna`: detect missing values

## Examples

```python theme={"system"}
>>> from sedona.spark.geopandas import GeoSeries
>>> from shapely.geometry import Polygon
>>> s = GeoSeries(
...     [
...         Polygon([(0, 0), (1, 1), (0, 1)]),
...         None,
...         Polygon([(0, 0), (-1, 1), (0, -1)]),
...     ]
... )
>>> s
0      POLYGON ((0 0, 1 1, 0 1, 0 0))
1                                None
2    POLYGON ((0 0, -1 1, 0 -1, 0 0))
dtype: geometry
```

Filled with an empty polygon.

```python theme={"system"}
>>> s.fillna()
0      POLYGON ((0 0, 1 1, 0 1, 0 0))
1            GEOMETRYCOLLECTION EMPTY
2    POLYGON ((0 0, -1 1, 0 -1, 0 0))
dtype: geometry
```

Filled with a specific polygon.

```python theme={"system"}
>>> s.fillna(Polygon([(0, 1), (2, 1), (1, 2)]))
0      POLYGON ((0 0, 1 1, 0 1, 0 0))
1      POLYGON ((0 1, 2 1, 1 2, 0 1))
2    POLYGON ((0 0, -1 1, 0 -1, 0 0))
dtype: geometry
```

Filled with another GeoSeries.

```python theme={"system"}
>>> from shapely.geometry import Point
>>> s_fill = GeoSeries(
...     [
...         Point(0, 0),
...         Point(1, 1),
...         Point(2, 2),
...     ]
... )
>>> s.fillna(s_fill)
0      POLYGON ((0 0, 1 1, 0 1, 0 0))
1                         POINT (1 1)
2    POLYGON ((0 0, -1 1, 0 -1, 0 0))
dtype: geometry
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.