File: xarray.md

package info (click to toggle)
flox 0.10.8-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,668 kB
  • sloc: python: 8,555; makefile: 172
file content (14 lines) | stat: -rw-r--r-- 611 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(xarray)=

# Xarray

Xarray will use flox by default (if installed) for DataArrays containing numpy and dask arrays. The default choice is `method="cohorts"` which generalizes
the best. Pass flox-specific kwargs to the specific reduction method:

```python
ds.groupby("time.month").mean(method="map-reduce", engine="flox")
ds.groupby_bins("lon", bins=[0, 10, 20]).mean(method="map-reduce")
ds.resample(time="M").mean(method="blockwise")
```

{py:func}`flox.xarray.xarray_reduce` used to provide extra functionality, but now Xarray's GroupBy object has been upgraded to match those capabilities with better API!