nctoolkit.DataSet.split

DataSet.split(self, by=None)

Split the dataset Each file in the ensemble will be separated into new files based on the splitting argument.

Parameters

by (str) – Available by arguments are ‘year’, ‘month’, ‘yearmonth’, ‘season’, ‘day’ ‘name’, “timestep”. year will split files by year, month will split files by month, yearmonth will split files by year and month; season will split files by year, day will split files by day. Using “timestep” will split files by timestep. ‘name’ will split by variable name

Examples

If you want to split each file into a dataset into a separate files for each year, do the following:

>>> ds.split("year")

If you wanted to split by month, do the following:

>>> ds.split("month")