@@ -80,7 +80,7 @@ def xarray_reduce(
8080 reindex : bool | None = None ,
8181 ** finalize_kwargs ,
8282):
83- """GroupBy reduce operations on xarray objects using numpy-groupies
83+ """GroupBy reduce operations on xarray objects using numpy-groupies.
8484
8585 Parameters
8686 ----------
@@ -105,26 +105,27 @@ def xarray_reduce(
105105 dim : hashable
106106 dimension name along which to reduce. If None, reduces across all
107107 dimensions of `by`
108- fill_value
108+ fill_value : Any
109109 Value used for missing groups in the output i.e. when one of the labels
110110 in ``expected_groups`` is not actually present in ``by``.
111111 dtype : data-type, optional
112- DType for the output. Can be anything accepted by ``np.dtype``.
112+ DType for the output. Can be anything that is accepted by ``np.dtype``.
113113 method : {"map-reduce", "blockwise", "cohorts"}, optional
114+ Note that this arg is chosen by default using heuristics.
114115 Strategy for reduction of dask arrays only:
115116 * ``"map-reduce"``:
116117 First apply the reduction blockwise on ``array``, then
117118 combine a few newighbouring blocks, apply the reduction.
118119 Continue until finalizing. Usually, ``func`` will need
119- to be an Aggregation instance for this method to work.
120+ to be an `` Aggregation`` instance for this method to work.
120121 Common aggregations are implemented.
121122 * ``"blockwise"``:
122123 Only reduce using blockwise and avoid aggregating blocks
123124 together. Useful for resampling-style reductions where group
124- members are always together. If `by` is 1D, `array` is automatically
125+ members are always together. If `` by`` is 1D, `` array` ` is automatically
125126 rechunked so that chunk boundaries line up with group boundaries
126127 i.e. each block contains all members of any group present
127- in that block. For nD `by `, you must make sure that all members of a group
128+ in that block. For nD ``by` `, you must make sure that all members of a group
128129 are present in a single block.
129130 * ``"cohorts"``:
130131 Finds group labels that tend to occur together ("cohorts"),
@@ -134,11 +135,11 @@ def xarray_reduce(
134135 'month', dayofyear' etc. Optimize chunking ``array`` for this
135136 method by first rechunking using ``rechunk_for_cohorts``
136137 (for 1D ``by`` only).
137- engine : {"flox", "numpy", "numba"}, optional
138+ engine : {"flox", "numpy", "numba", "numbagg" }, optional
138139 Algorithm to compute the groupby reduction on non-dask arrays and on each dask chunk:
139140 * ``"numpy"``:
140141 Use the vectorized implementations in ``numpy_groupies.aggregate_numpy``.
141- This is the default choice because it works for other array types.
142+ This is the default choice because it works for most array types.
142143 * ``"flox"``:
143144 Use an internal implementation where the data is sorted so that
144145 all members of a group occur sequentially, and then numpy.ufunc.reduceat
@@ -162,13 +163,13 @@ def xarray_reduce(
162163 NA. Only used if skipna is set to True or defaults to True for the
163164 array's dtype.
164165 reindex : bool, optional
165- Whether to "reindex" the blockwise results to `expected_groups` (possibly automatically detected).
166+ Whether to "reindex" the blockwise results to `` expected_groups` ` (possibly automatically detected).
166167 If True, the intermediate result of the blockwise groupby-reduction has a value for all expected groups,
167168 and the final result is a simple reduction of those intermediates. In nearly all cases, this is a significant
168169 boost in computation speed. For cases like time grouping, this may result in large intermediates relative to the
169- original block size. Avoid that by using method="cohorts". By default, it is turned off for arg reductions .
170- **finalize_kwargs
171- kwargs passed to the finalize function, like ``ddof`` for var, std or ``q`` for quantile.
170+ original block size. Avoid that by using `` method="cohorts"`` . By default, it is turned off for argreductions .
171+ **finalize_kwargs : dict, optional
172+ Kwargs passed to finalize the reduction such as ``ddof`` for var, std or ``q`` for quantile.
172173
173174 Returns
174175 -------
0 commit comments