xarray.Dataset.pr.coverage

Dataset.pr.coverage(*dims: Hashable) DataFrame | Series

Summarize how many data points exist for a dimension combination.

For each combinations of values in the given dimensions, count the number of non-NaN data points in the dataset. The result is returned as an N-dimensional pandas DataFrame.

Only those data variables in the dataset are considered which are defined on all given dims, i.e. each dim is in ds[key].dims.

If the dataset only contains boolean arrays, count the number of True values instead. This makes it possible to easily apply preprocessing. For example, to count the number of valid time series use ds.notnull().any("time").coverage(...).

Parameters:
*dims: str

Names or aliases of the dimensions to be used for summarizing. To use the name of the data variables (usually, the gases) as a coordinate, use “entity”. You can specify any number of dimensions, but the readability of the result is best for one or two dimensions.

Returns:
coverage: pandas.DataFrame or pandas.Series

N-dimensional dataframe (series for N=1) summarizing the number of non-NaN data points for each combination of values in the given dimensions.