flox
GroupBy operations for dask.array
What it is and what it does
Flox is a library for performing GroupBy reduction operations efficiently on arrays with dask and xarray. It was created to address performance bottlenecks in GroupBy operations and to bring fast aggregations to the dask ecosystem. The package provides two main interfaces: a pure array function (groupby_reduce) and an xarray-specific function (xarray_reduce), both supporting common reductions like mean, sum, and count, as well as custom aggregations defined via an Aggregation class.
The library depends on pandas, numpy, scipy, packaging, toolz, and numpy_groupies to deliver its functionality. It is actively maintained, supports Python 3.11–3.14, and carries an Apache-2.0 license. With low install friction and no known security vulnerabilities, it is suitable for scientific computing workflows that require scalable GroupBy operations on large, chunked arrays.
Use it for:
- Compute grouped statistics on large arrays without materializing the full dataset in memory.
- Perform GroupBy reductions on multi-dimensional scientific data in a distributed setting.
- Define custom aggregation logic for domain-specific GroupBy operations on chunked arrays.
- Integrate fast GroupBy operations into Earth science data analysis pipelines.
- Reduce intermediate results from blockwise operations using combine and finalize strategies.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Flox provides fast GroupBy reduction operations for arrays using dask and xarray, offering interfaces for common aggregations like mean and sum, plus custom reductions.
Yes. Flox is actively maintained, has no security vulnerabilities, and low install friction. It directly addresses performance needs in GroupBy operations for scientific computing. The Apache-2.0 license is permissive. Install it if you need efficient grouped reductions on arrays; the Beta status is not a barrier given the active maintenance and NASA-funded backing.
Install
flox on PyPI
pip
pip install floxuv
uv add floxpoetry
poetry add floxInstalling flox
Before you install
Low install friction with a pure Python wheel and six well-established dependencies. Active maintenance with recent commits; marked Beta but supported on current Python versions (3.11–3.14).
License in practice
Apache-2.0 permissive license allows use in most projects without restriction, including commercial applications.
Quickstart
pip install flox
import flox
# GroupBy reduction using groupby_reduce
result = flox.groupby_reduce(array, by_array, "mean")
Requires Python 3.11 or later.
Verify before relying
- Whether custom Aggregation support is fully functional (description notes it 'might not be fully functional at the moment').
- Performance benchmarks or typical speedup factors compared to alternative GroupBy approaches.
- Whether xarray integration has progressed beyond the ongoing work mentioned in the description.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — pandas, packaging, numpy, numpy_groupies, toolz, scipy |
| Maintenance | actively maintained — 169 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 352,795/month — #7,309 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flox-0.11.2-py3-none-any.whl
Keywords: xarray, dask, groupby
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
numpy-groupiesProvides optimized group-indexing operations on…
permissive · top 15,000 on PyPI
window-opsProvides numba-optimized window operations…
permissive · top 15,000 on PyPI
dask-exprDask Expressions provides query optimization…
permissive · top 5,000 on PyPI
xarrayxarray adds dimension, coordinate, and…
permissive · top 5,000 on PyPI
accumulation-treeImplements a red/black tree that stores partial…
permissive · top 15,000 on PyPI
rasterixRasterix provides tools for analyzing raster…
permissive · top 15,000 on PyPI
daskDask is a parallel computing library that…
permissive · top 1,000 on PyPI
odc-loaderConstructs xarray objects from parsed…
permissive · top 15,000 on PyPI
linopylinopy builds linear, integer, and quadratic…
permissive · top 15,000 on PyPI
qpdQPD translates SQL SELECT statements into…
permissive · top 15,000 on PyPI