flox-9.11
توضیحات
GroupBy operations for dask.array
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | flox-9.11 |
| نام | flox |
| نسخه کتابخانه | 9.11 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/flox/ |
| مجوز | - |
[](https://github.com/xarray-contrib/flox/actions)
[](https://results.pre-commit.ci/latest/github/xarray-contrib/flox/main)
[](https://codecov.io/gh/xarray-contrib/flox)
[](https://flox.readthedocs.io/en/latest/?badge=latest)
[](https://pypi.org/project/flox/)
[](https://anaconda.org/conda-forge/flox)
[](https://earthdata.nasa.gov/esds/competitive-programs/access/pangeo-ml)
[](https://science.nasa.gov/open-science-overview)
# flox
This project explores strategies for fast GroupBy reductions with dask.array. It used to be called `dask_groupby`
It was motivated by
1. Dask Dataframe GroupBy
[blogpost](https://blog.dask.org/2019/10/08/df-groupby)
1. [numpy_groupies](https://github.com/ml31415/numpy-groupies) in Xarray
[issue](https://github.com/pydata/xarray/issues/4473)
(See a
[presentation](https://docs.google.com/presentation/d/1YubKrwu9zPHC_CzVBhvORuQBW-z148BvX3Ne8XcvWsQ/edit?usp=sharing)
about this package, from the Pangeo Showcase).
## Acknowledgements
This work was funded in part by
1. NASA-ACCESS 80NSSC18M0156 "Community tools for analysis of NASA Earth Observing System
Data in the Cloud" (PI J. Hamman, NCAR),
1. NASA-OSTFL 80NSSC22K0345 "Enhancing analysis of NASA data with the open-source Python Xarray Library" (PIs Scott Henderson, University of Washington; Deepak Cherian, NCAR; Jessica Scheick, University of New Hampshire), and
1. [NCAR's Earth System Data Science Initiative](https://ncar.github.io/esds/).
It was motivated by [very](https://github.com/pangeo-data/pangeo/issues/266) [very](https://github.com/pangeo-data/pangeo/issues/271) [many](https://github.com/dask/distributed/issues/2602) [discussions](https://github.com/pydata/xarray/issues/2237) in the [Pangeo](https://pangeo.io) community.
## API
There are two main functions
1. `flox.groupby_reduce(dask_array, by_dask_array, "mean")`
"pure" dask array interface
1. `flox.xarray.xarray_reduce(xarray_object, by_dataarray, "mean")`
"pure" xarray interface; though [work is ongoing](https://github.com/pydata/xarray/pull/5734) to integrate this
package in xarray.
## Implementation
See [the documentation](https://flox.readthedocs.io/en/latest/implementation.html) for details on the implementation.
## Custom reductions
`flox` implements all common reductions provided by `numpy_groupies` in `aggregations.py`.
It also allows you to specify a custom Aggregation (again inspired by dask.dataframe),
though this might not be fully functional at the moment. See `aggregations.py` for examples.
```python
mean = Aggregation(
# name used for dask tasks
name="mean",
# operation to use for pure-numpy inputs
numpy="mean",
# blockwise reduction
chunk=("sum", "count"),
# combine intermediate results: sum the sums, sum the counts
combine=("sum", "sum"),
# generate final result as sum / count
finalize=lambda sum_, count: sum_ / count,
# Used when "reindexing" at combine-time
fill_value=0,
# Used when any member of `expected_groups` is not found
final_fill_value=np.nan,
)
```
نیازمندی
| مقدار | نام |
|---|---|
| - | pandas>=2.1 |
| - | packaging>=21.3 |
| - | numpy>=1.26 |
| - | numpy_groupies>=0.9.19 |
| - | toolz |
| - | scipy>=1.12 |
| xtr | cachey; |
| xtr | dask; |
| xtr | numba; |
| xtr | numbagg; |
| xtr | xarray; |
| xtr | netCDF4; |
| xtr | cubed>=0.20.0; |
| xtr | cubed-xarray; |
| xtr | dask; |
| xtr | xarray; |
| xtr | numpydoc; |
| xtr | matplotlib; |
| xtr | myst-parser; |
| xtr | myst-nb; |
| xtr | sparse; |
| xtr | sphinx; |
| xtr | sphinx-remove-toctrees; |
| xtr | furo>=2024.08; |
| xtr | ipykernel; |
| xtr | jupyter; |
| xtr | sphinx-codeautolink; |
| xtr | sphinx-copybutton; |
| xtr | pyarrow; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.11 | Python |
نحوه نصب
نصب پکیج whl flox-9.11:
pip install flox-9.11.whl
نصب پکیج tar.gz flox-9.11:
pip install flox-9.11.tar.gz