--- title: "system.dataset.clearDataset" description: "Takes a dataset and returns a new dataset with all of the same column names, but all of the rows deleted." --- # system.dataset.clearDataset > Takes a dataset and returns a new dataset with all of the same column names, but all of the rows deleted. 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 all of the same column names and types, but no rows. :::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.clearDataset(dataset)` ### Parameters Type | Parameter | Description ------- | ------- | ------- Dataset | `dataset` | The starting dataset. ### Returns **Dataset** - A new dataset with no rows. ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Code Snippet" # This example pulls in the dataset from a Vision Table component, clears it, then writes the empty dataset back to the table. data = event.source.parent.getComponent('Table').data event.source.parent.getComponent('Table').data = system.dataset.clearDataset(data) ```