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