> ## 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.

# ST_Difference (Python)

> Calculate the difference of two geometry columns.

Calculate the difference of two geometry columns. This difference
is not symmetric. It only returns the part of geometry a that is not
in b.

SQL reference: [`ST_Difference`](/reference/wherobots-db/geometry-data/overlay/ST_Difference)

## Signature

```python theme={"system"}
from sedona.spark.sql.st_functions import ST_Difference

ST_Difference(a: ColumnOrName, b: ColumnOrName) -> Column
```

## Parameters

<ParamField path="a" type="ColumnOrName" required>
  Geometry column to use in the calculation.
</ParamField>

<ParamField path="b" type="ColumnOrName" required>
  Geometry column to subtract from geometry column a.
</ParamField>

## Returns

<ResponseField name="return" type="Column">
  Part of geometry a that is not in b as a geometry column.
</ResponseField>


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