decode.stats module#
- all(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
alloperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
alloperation will be applied. If a dictionary such as{dim: size, ...}is specified, then thealloperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
alloperation.**options (Any) – Other options to be passed to the
alloperation.
- Returns:
DataArray that the (chunked)
alloperation is applied.- Return type:
DataArray
- any(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
anyoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
anyoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then theanyoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
anyoperation.**options (Any) – Other options to be passed to the
anyoperation.
- Returns:
DataArray that the (chunked)
anyoperation is applied.- Return type:
DataArray
- apply(da: DataArray, func: Callable[[...], Any] | str, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked) statistical operation to a DataArray.
- Parameters:
da (DataArray) – Input DataArray.
func (Callable[[...], Any] | str) – Function or name of the statistical operation (e.g.
'mean').dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the statistical operation will be applied. If a dictionary such as
{dim: size, ...}is specified, then the statistical operation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the statistical operation.
**options (Any) – Other options to be passed to the statistical operation.
- Returns:
DataArray that the (chunked) statistical operation is applied.
- Return type:
DataArray
- count(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
countoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
countoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then thecountoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
countoperation.**options (Any) – Other options to be passed to the
countoperation.
- Returns:
DataArray that the (chunked)
countoperation is applied.- Return type:
DataArray
- first(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
firstoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
firstoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then thefirstoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
firstoperation.**options (Any) – Other options to be passed to the
firstoperation.
- Returns:
DataArray that the (chunked)
firstoperation is applied.- Return type:
DataArray
- last(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
lastoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
lastoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then thelastoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
lastoperation.**options (Any) – Other options to be passed to the
lastoperation.
- Returns:
DataArray that the (chunked)
lastoperation is applied.- Return type:
DataArray
- max(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
maxoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
maxoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then themaxoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
maxoperation.skipna (bool | None) – Whether to ignore missing values in the
maxoperation.**options (Any) – Other options to be passed to the
maxoperation.
- Returns:
DataArray that the (chunked)
maxoperation is applied.- Return type:
DataArray
- mean(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
meanoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
meanoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then themeanoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
meanoperation.skipna (bool | None) – Whether to ignore missing values in the
meanoperation.**options (Any) – Other options to be passed to the
meanoperation.
- Returns:
DataArray that the (chunked)
meanoperation is applied.- Return type:
DataArray
- median(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
medianoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
medianoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then themedianoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
medianoperation.skipna (bool | None) – Whether to ignore missing values in the
medianoperation.**options (Any) – Other options to be passed to the
medianoperation.
- Returns:
DataArray that the (chunked)
medianoperation is applied.- Return type:
DataArray
- min(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
minoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
minoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then theminoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
minoperation.skipna (bool | None) – Whether to ignore missing values in the
minoperation.**options (Any) – Other options to be passed to the
minoperation.
- Returns:
DataArray that the (chunked)
minoperation is applied.- Return type:
DataArray
- prod(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
prodoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
prodoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then theprodoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
prodoperation.skipna (bool | None) – Whether to ignore missing values in the
prodoperation.**options (Any) – Other options to be passed to the
prodoperation.
- Returns:
DataArray that the (chunked)
prodoperation is applied.- Return type:
DataArray
- std(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
stdoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
stdoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then thestdoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
stdoperation.skipna (bool | None) – Whether to ignore missing values in the
stdoperation.**options (Any) – Other options to be passed to the
stdoperation.
- Returns:
DataArray that the (chunked)
stdoperation is applied.- Return type:
DataArray
- sum(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
sumoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
sumoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then thesumoperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
sumoperation.skipna (bool | None) – Whether to ignore missing values in the
sumoperation.**options (Any) – Other options to be passed to the
sumoperation.
- Returns:
DataArray that the (chunked)
sumoperation is applied.- Return type:
DataArray
- var(da: DataArray, /, *, dim: str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int] = None, boundary: Literal['exact', 'trim', 'pad'] = 'trim', side: Literal['left', 'right'] | dict[Hashable, Literal['left', 'right']] = 'left', numeric_coord_func: Callable[[...], Any] | str = 'mean', nonnumeric_coord_func: Callable[[...], Any] | str = 'first', keep_attrs: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
varoperation to a DataArray.- Parameters:
da (DataArray) – Input DataArray.
dim (str | Collection[Hashable] | EllipsisType | None | dict[Hashable, int]) – Name(s) of the dimension(s) along which the
varoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then thevaroperation will be applied to every data chunk of given size.boundary (Literal['exact', 'trim', 'pad']) – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side (Literal['left', 'right'] | dict[~collections.abc.Hashable, ~typing.Literal['left', 'right']]) – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func (Callable[[...], Any] | str) – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs (bool | None) – Whether to keep attributes in the
varoperation.skipna (bool | None) – Whether to ignore missing values in the
varoperation.**options (Any) – Other options to be passed to the
varoperation.
- Returns:
DataArray that the (chunked)
varoperation is applied.- Return type:
DataArray