tiledbsoma.DataFrame.delete_cells

DataFrame.delete_cells(coords: Sequence[None | bytes | Slice[bytes] | Sequence[bytes] | float | Slice[float] | Sequence[float] | int | Slice[int] | Sequence[int] | slice | Slice[slice] | Sequence[slice] | str | Slice[str] | Sequence[str] | datetime64 | Slice[datetime64] | Sequence[datetime64] | TimestampType | Slice[TimestampType] | Sequence[TimestampType] | Array | ChunkedArray | ndarray[tuple[Any, ...], dtype[integer]] | ndarray[tuple[Any, ...], dtype[datetime64]]] = (), *, value_filter: str | None = None, platform_config: Dict[str, Mapping[str, Any]] | object | None = None) None

Deletes cells at the specified coordinates.

Either coords or value_filter must be provided. When both coords and value_filter are provided, the cells that match both constraints will be removed.

For example, to delete values from the obs dataframe with soma_joinid<=1000 where n_genes > 1000 and n_counts < 2000:

>>> with tiledbsoma.DataFrame(obs_uri, mode="d") as obs_df:
...     obs_df.delete_cells((slice(None, 1000),), value_filter="n_genes > 1000 and n_counts < 2000")

Note: Deleting cells does not change the size of the current domain or possible enumeration values.

Parameters:
  • coords – A per-dimension Sequence of scalar, slice, sequence of scalar or Arrow IntegerArray <https://arrow.apache.org/docs/python/generated/pyarrow.IntegerArray.html> values defining the region to read.

  • value_filter – An optional [value filter] to apply to the results. Defaults to no filter.