annual_mean#
- annual_mean(data, tstart, tend, time_axis=0)[source]#
Compute annual means for daily, contiguous data in [tstart, tend] (inclusive).
Partial first or last years are averaged over the available days.
- Parameters:
data (np.ndarray) – Input array. One axis is time (daily).
tstart (datetime.datetime) – Inclusive range of the data.
tend (datetime.datetime) – Inclusive range of the data.
time_axis (int) – Axis that represents time in data.
- Returns:
yearly (np.ndarray) – Annual means with time axis replaced by number of years.
year_labels (np.ndarray of datetime64[Y]) – Year labels for each output slice.