earthkit.meteo.score.resample

earthkit.meteo.score.resample(x: ArrayLike, *args: ArrayLike, dim: int | list[int] = 0, out_dim: int = 0, n_iter: int = 100, n_samples: int | None = None, replace: bool = True, rng: numpy.random.Generator | None = None) tuple[ArrayLike, Ellipsis]
earthkit.meteo.score.resample(x: xarray.DataArray, *args: xarray.DataArray, dim: str = None, out_dim: str = 'sample', n_iter: int = 100, n_samples: int | None = None, replace: bool = True, rng: numpy.random.Generator | None = None) tuple[xarray.DataArray, Ellipsis]

Resample arrays for bootstrapping.

Parameters:
  • x (xarray object or array-like) – Arrays to sample. Must have the same size along dim

  • *args (xarray object or array-like) – Arrays to sample. Must have the same size along dim

  • dim (str or int or list of int) – Sample along this dimension (name or index/indices for array-like)

  • out_dim (str or int) – Output dimension name (or index for array-like) for samples

  • n_iter (int) – Number of bootstrapping iterations

  • n_samples (int or None) – Number of samples for each iteration. If None, use the number of inputs (size of x along the sampling dimension)

  • replace (bool) – Sample with replacement (on by default)

  • rng (numpy.random.Generator) – Random number generator

Returns:

Resampled arrays (one element per input array)

Return type:

tuple