system.dataset.deleteRows

Description

Takes a dataset and returns a new dataset with one or more rows removed. Datasets are immutable, so it is important to realize that this function does not actually remove the rows from the argument dataset. You'll need to do something with the new dataset that this function creates to achieve something useful.

Syntax

system.dataset.deleteRows(dataset, rowIndices)

  • Parameters

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.

int[] 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 len(dataset)-1.

  • Returns

Dataset - A new dataset with the specified rows removed.

  • Scope

All

Code Examples
Code Snippet
#This example would remove several rows from a Table component, by re-assigning the Table's data property to the new dataset returned by thedeleteRows 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