Fast Array Utilities (fast-array-utils) is a Python library providing high-performance array manipulation and statistical utilities with minimal dependencies. It supports a wide range of array types including `numpy.ndarray`, `scipy.sparse` formats, `cupy.ndarray`, `dask.array.Array`, `h5py.Dataset`, `zarr.Array`, and `anndata.abc.CS{CR}Dataset`. The current version is 1.4.1, with an active development status and regular updates within the `scverse` ecosystem.
Install & Compatibility
Where this runs
tested against v1.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.10
✕ build_error
✕ build_error
py 3.9
✕ build_error
✕ build_error
86MB installed
● package 86MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
from fast_array_utils.conv import to_dense
from fast_array_utils import stats
from fast_array_utils import conv
This quickstart demonstrates converting a sparse matrix to a dense NumPy array using `to_dense` from the `conv` submodule and calculating statistics like sums and means using the `stats` submodule. Note that the `stats` submodule requires the optional `accel` dependencies to be installed.
import numpy as np
from scipy.sparse import csr_matrix
from fast_array_utils.conv import to_dense
from fast_array_utils import stats
# Example with to_dense
sparse_matrix = csr_matrix(np.array([[0, 1, 0], [1, 0, 2], [0, 0, 0]]))
numpy_arr = to_dense(sparse_matrix)
print(f"Dense array from sparse matrix:\n{numpy_arr}")
# Example with stats module (requires 'fast-array-utils[accel]' to be installed)
try:
data_2d = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
col_sums = stats.sum(data_2d, axis=0)
mean_val = stats.mean(data_2d)
print(f"\nColumn sums: {col_sums}")
print(f"Mean value: {mean_val}")
except ImportError:
print("\nSkipping stats examples: 'fast-array-utils[accel]' not installed.")
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.