demist.stats module#
- demist.stats.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, keep_dims: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
alloperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
alloperation.keep_dims – Whether to keep dimensions in the
alloperation.**options – Other options to be passed to the
alloperation.
- Returns:
DataArray that the (chunked)
alloperation is applied.
- demist.stats.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, keep_dims: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
anyoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
anyoperation.keep_dims – Whether to keep dimensions in the
anyoperation.**options – Other options to be passed to the
anyoperation.
- Returns:
DataArray that the (chunked)
anyoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked) statistical operation to a DataArray.
- Parameters:
da – Input DataArray.
func – Function or name of the statistical operation (e.g.
'mean').dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the statistical operation.
keep_dims – Whether to keep dimensions in the statistical operation.
**options – Other options to be passed to the statistical operation.
- Returns:
DataArray that the (chunked) statistical operation is applied.
- demist.stats.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, keep_dims: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
countoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
countoperation.keep_dims – Whether to keep dimensions in the
countoperation.**options – Other options to be passed to the
countoperation.
- Returns:
DataArray that the (chunked)
countoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
firstoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
firstoperation.keep_dims – Whether to keep dimensions in the
firstoperation.**options – Other options to be passed to the
firstoperation.
- Returns:
DataArray that the (chunked)
firstoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
lastoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
lastoperation.keep_dims – Whether to keep dimensions in the
lastoperation.**options – Other options to be passed to the
lastoperation.
- Returns:
DataArray that the (chunked)
lastoperation is applied.
- demist.stats.mad(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, keep_dims: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
madoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – Name(s) of the dimension(s) along which the
madoperation will be applied. If a dictionary such as{dim: size, ...}is specified, then themadoperation will be applied to every data chunk of given size.boundary – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
madoperation.keep_dims – Whether to keep dimensions in the
madoperation.skipna – Whether to ignore missing values in the
madoperation.**options – Other options to be passed to the
madoperation.
- Returns:
DataArray that the (chunked)
madoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
maxoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
maxoperation.keep_dims – Whether to keep dimensions in the
maxoperation.skipna – Whether to ignore missing values in the
maxoperation.**options – Other options to be passed to the
maxoperation.
- Returns:
DataArray that the (chunked)
maxoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
meanoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
meanoperation.keep_dims – Whether to keep dimensions in the
meanoperation.skipna – Whether to ignore missing values in the
meanoperation.**options – Other options to be passed to the
meanoperation.
- Returns:
DataArray that the (chunked)
meanoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
medianoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
medianoperation.keep_dims – Whether to keep dimensions in the
medianoperation.skipna – Whether to ignore missing values in the
medianoperation.**options – Other options to be passed to the
medianoperation.
- Returns:
DataArray that the (chunked)
medianoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
minoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
minoperation.keep_dims – Whether to keep dimensions in the
minoperation.skipna – Whether to ignore missing values in the
minoperation.**options – Other options to be passed to the
minoperation.
- Returns:
DataArray that the (chunked)
minoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
prodoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
prodoperation.keep_dims – Whether to keep dimensions in the
prodoperation.skipna – Whether to ignore missing values in the
prodoperation.**options – Other options to be passed to the
prodoperation.
- Returns:
DataArray that the (chunked)
prodoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
stdoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
stdoperation.keep_dims – Whether to keep dimensions in the
stdoperation.skipna – Whether to ignore missing values in the
stdoperation.**options – Other options to be passed to the
stdoperation.
- Returns:
DataArray that the (chunked)
stdoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
sumoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
sumoperation.keep_dims – Whether to keep dimensions in the
sumoperation.skipna – Whether to ignore missing values in the
sumoperation.**options – Other options to be passed to the
sumoperation.
- Returns:
DataArray that the (chunked)
sumoperation is applied.
- demist.stats.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, keep_dims: bool | None = None, skipna: bool | None = None, **options: Any) DataArray[source]#
Apply a (chunked)
varoperation to a DataArray.- Parameters:
da – Input DataArray.
dim – 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 – Same option as
xarray.DataArray.coarsenbut defaults to'trim'.side – Same option as
xarray.DataArray.coarsenand defualts to'left'.numeric_coord_func – Function or name of the statistical operation for the numeric coordinates (bool, numbers, datetime, timedelta).
nonnumeric_coord_func – Function or name of the statistical operation for the non-numeric coordinates (str, bytes, and general object).
keep_attrs – Whether to keep attributes in the
varoperation.keep_dims – Whether to keep dimensions in the
varoperation.skipna – Whether to ignore missing values in the
varoperation.**options – Other options to be passed to the
varoperation.
- Returns:
DataArray that the (chunked)
varoperation is applied.