xdas.median#

xdas.median(da, dim=None, *, skipna=True, **kwargs)[source]#

Compute the median along the specified dimension.

Parameters:
  • da (DataArray) – Input data.

  • dim (str, optional) – Dimension along which the median is computed. If None, the median of the flattened array is returned. Default is None.

  • skipna (bool, optional) – Whether to exclude NaN values (True) or include them (False) in the computation. Default is True.

  • **kwargs – Additional keyword arguments passed to the NumPy function.

Returns:

Median value(s) along the specified dimension. If dim is None, a single scalar value is returned; if dim is specified, the result has the same shape as the input data.

Return type:

scalar or DataArray