nctoolkit.DataSet.drop

DataSet.drop(self, vars=None)

Remove variables This will remove stated variables from files in the dataset.

Parameters

vars (str or list) – Variable or variables to be removed from the dataset. Variables that are listed but not in the dataset will be ignored

Examples

If you wanted to remove a single variable ‘var1’ from a dataset data, you would do the following:

>>> ds.drop('var')

If you wanted to remove a list of variables, you would do the following:

>>> ds.drop(['var1', 'var2', 'var2'])