nctoolkit.DataSet.tstdev¶
- DataSet.tstdev(self, over='time')¶
Calculate the temporal standard deviation of all variables
- Parameters
over (str or list) – Time periods to average over. Options are ‘year’, ‘month’, ‘day’.
Examples
If you want to calculate standard deviation over all time steps. Do the following:
>>> ds.tstdev()
If you want to calculate the standard deviation for each year in a dataset, do this:
>>> ds.tstdev("year")
If you want to calculate the standard deviation for each month in a dataset, do this:
>>> ds.tstdev("month")
If you want to calculate the standard deviation for each month in each year in a dataset, do this:
>>> ds.tstdev(["year", "month"])
This method will also let you easily calculate climatologies. So, if you wanted to calculate a monthly climatological var, you would do this:
>>> ds.tstdev("month")
A daily climatological standard deviation would be the following:
>>> ds.tstdev("day")