nctoolkit.DataSet.na_frac

DataSet.na_frac(over='time', align='right', window=None)

na_frac: Calculate the fraction of missing values in each grid cell across all time steps.

Parameters:
  • over (str or list) – Time periods to to the count over over. Options are ‘time’, ‘year’, ‘month’, ‘day’.

  • 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”

  • window (int) – This determines the number of time steps to calculate over, on a non-rolling basis. This is useful if you need to calculate the fraction for every non-overlapping 5 day periods, for example.

Examples

If you want to calculate the fraction of missing values over all time steps. Do the following: >>> ds.na_frac() If you want to calculate the fraction of missing values in each year: >>> ds.na_frac(over=”year”)