# Collection.delete

```python
def Collection.delete(
    datapoints: DatapointIDs,
    *,
    show_progress: bool | Callable[[float], None] = False,
) -> int
```

Delete data points from the collection.

Data points are identified and deleted by their ids.

You need to have write permission on the collection to be able to delete data points.

## Parameters

**datapoints**

`DatapointIDs`

Datapoint IDs to delete from the collection.

Supported `DatapointIDs` types are:

* A `pandas.DataFrame` containing an `id` column.
* A `pandas.Series` containing datapoint IDs.
* An `xarray.Dataset` containing an "id" variable.
* An `xarray.DataArray` containing datapoint IDs.
* A `numpy.ndarray` containing datapoint IDs.
* A `Collection[UUID]` containing datapoint IDs as python built-in `UUID` objects, e.g. `list[UUID]`.
* A `Collection[str]` containing datapoint IDs as strings, e.g. `list[str]`.

**show\_progress**

`bool | Callable[[float], None]`

If `True`, display a progress bar while deleting many datapoints. You can also pass a callback to receive progress values between `0` and `1`. Defaults to `False`.

## Returns

The number of data points that were deleted.

```python title="Python"
collection.delete([
  "0195c87a-49f6-5ffa-e3cb-92215d057ea6",
  "0195c87b-bd0e-3998-05cf-af6538f34957",
])
```

## Errors

**NotFoundError**

`No such collection: Non-existent-Collection`

One of the data points is not found in the collection. If any of the data points are not found,
nothing will be deleted.

**ValueError**

`Invalid UUID`

One of the specified ids is not a valid UUID
