Fast array utilities with minimal dependencies.
Project Links
Meta
Author: Philipp A.
Requires Python: >=3.12
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
Programming Language
- Python :: 3 :: Only
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
usage
fast-array-utils supports the following array types:
numpy.ndarray
scipy.sparse.cs{rc}_{array,matrix}
cupy.ndarray and cupyx.scipy.sparse.cs{rc}_matrix
dask.array.Array
h5py.Dataset and zarr.Array
anndata.abc.CS{CR}Dataset (only supported by .conv.to_dense at the moment)
Use fast_array_utils.conv.to_dense to densify arrays and optionally move them to CPU memory:
from fast_array_utils.conv import to_dense
numpy_arr = to_dense(sparse_arr_or_mat)
numpy_arr = to_dense(dask_or_cuda_arr, to_cpu_memory=True)
dense_dask_arr = to_dense(dask_arr)
dense_cupy_arr = to_dense(sparse_cupy_mat)
Use fast_array_utils.conv.* to calculate statistics across one or both axes of a 2D array. All of them support an axis and dtype parameter:
from fast_array_utils import stats
all_equal = stats.is_constant(arr_2d)
col_sums = stats.sum(arr_2d, axis=0)
mean = stats.mean(arr_2d)
row_means, row_vars = stats.mean_var(arr_2d, axis=1)
installation
To use fast_array_utils.stats or fast_array_utils.conv:
(uv) pip install 'fast-array-utils[accel]'
To use testing.fast_array_utils:
(uv) pip install 'fast-array-utils[testing]'
1.4
Mar 27, 2026
1.3.1
Nov 18, 2025
1.3
Oct 28, 2025
1.2.5
Oct 17, 2025
1.2.4
Oct 15, 2025
1.2.3
Aug 25, 2025
1.2.2
Aug 25, 2025
1.2.1
May 09, 2025
1.2
May 06, 2025
1.1.2
Apr 29, 2025
1.1.1
Apr 28, 2025
1.1
Apr 25, 2025
1.0
Apr 15, 2025