skillfed

flox

GroupBy operations for dask.array

flox v0.11.2 352.8K downloads/30d#7,309 on PyPI137
Permissive license Apache-2.0 Active released

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 flox

uv

uv add flox

poetry

poetry add flox

Installing 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

Development Status :: 4 - BetaNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

groupby reductionsfast groupby operationsxarray aggregationsarray groupbydistributed aggregationsgrouped statisticsarray reduce operations
scientific-computingarray-operations

More Scientific/Engineering packages