--- title: "system.dataset.deleteRows" description: "Takes a dataset and returns a new dataset with one or more rows removed." --- # system.dataset.deleteRows > Takes a dataset and returns a new dataset with one or more rows removed. This function is used in **Python Scripting**. ## Description Takes a [dataset](platform/scripting/python-scripting/variables-datatypes-and-objects/datasets.md) and returns a new dataset with one or more rows removed. :::note Datasets are immutable, which means they cannot be directly modified once created. Instead, this scripting function returns a new dataset with some modification applied, which must be assigned to a variable to be used. See [Altering a Dataset](platform/scripting/python-scripting/variables-datatypes-and-objects/datasets.md#altering-a-dataset). ::: ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.dataset.deleteRows(dataset, rowIndices)` ### Parameters Type | Parameter | Description ------- | ------- | ------- Dataset | `dataset` | The starting dataset. Please be aware that this dataset will not actually be modified (datasets are immutable), but rather will be the starting point for creating a new dataset. List[Integer] | `rowIndices` | The indices (starting at 0) of the rows to delete. Will throw an IndexError if any element is less than zero or greater than the number of rows in the dataset - 1. ### Returns **Dataset** - A new dataset with the specified rows removed. ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Code Snippet" # This example would remove several rows from a Vision Table component, by re-assigning the Table's data property to the new dataset returned by the deleteRows function. ds = event.source.parent.getComponent('Table').data rows = [0,2,3,4] ds = system.dataset.deleteRows(ds, rows) event.source.parent.getComponent('Table').data = ds ```