nctoolkit.DataSet.tpercentile

DataSet.tpercentile(self, p=None, over='time', align='right')

Calculate the temporal percentile of all variables

Parameters
  • p (float or int) – Percentile to calculate

  • align (str) – This determines whether the output time is at the left, centre or right hand side of the time window. Options are “left”, “centre” and “right”

Examples

If you want to calculate the 20th percentile over all time steps. Do the following:

>>> ds.tpercentile(20)

If you want to calculate the 20th percentile for each year in a dataset, do this:

>>> ds.tpercentile(20)