xarray-einstats
Stats, linear algebra and einops for xarray
What it is and what it does
xarray-einstats bridges the gap between xarray's labeled array clarity and NumPy/SciPy's functional depth. When xarray operations become verbose or when you need linear algebra or statistical functions, this package provides thin wrappers that preserve dimension names and coordinate information instead of forcing you back to positional indexing. It wraps numpy.linalg and scipy.stats functions, plus einops tensor operations, with an API designed for xarray's labeled semantics.
The package targets scientific and statistical workflows where you work with multi-dimensional data and want to perform matrix operations or statistical tests without losing your dimension labels. It's in active development (Alpha status) and maintained as part of the ArviZ ecosystem.
Use it for:
- Compute matrix decompositions on xarray variables while preserving dimension names
- Apply scipy.stats functions to labeled multi-dimensional arrays without reshaping to NumPy
- Reshape and transpose xarray data using einops syntax adapted for labeled dimensions
- Perform linear algebra on Bayesian posterior samples organized by chain and draw dimensions
- Stack or reshape dimensions in scientific datasets while maintaining coordinate metadata
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides xarray-friendly wrappers around NumPy linear algebra, SciPy statistics, and einops operations, reducing verbosity while preserving labeled array semantics.
Yes, if you regularly work with xarray and need NumPy linear algebra or SciPy statistics without losing dimension labels. Low install friction, active maintenance, permissive license, and no known vulnerabilities. Alpha status means the API may evolve, but it's suitable for workflows where clarity and labeled semantics matter more than API stability guarantees.
Install
xarray-einstats on PyPI
pip
pip install xarray-einstatsuv
uv add xarray-einstatspoetry
poetry add xarray-einstatsInstalling xarray-einstats
Before you install
Low friction: pure Python wheel with only three runtime dependencies (numpy, scipy, xarray). Last release 25 days ago; repository active with recent commits.
License in practice
Permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install xarray-einstats
import xarray as xr
import xarray_einstats
# Use wrapped functions on xarray DataArrays
da = xr.DataArray(...)
result = xarray_einstats.linalg.svd(da)
Requires Python 3.12 or later.
Verify before relying
- Whether einops is an optional or required transitive dependency (not listed in runtime deps)
- Scope and maturity of scipy.stats wrapper coverage
- Performance characteristics vs. direct numpy/scipy calls
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — numpy, scipy, xarray |
| Maintenance | actively maintained — 25 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,165,943/month — #3,235 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: xarray_einstats-0.11.0-py3-none-any.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
xarrayxarray adds dimension, coordinate, and…
permissive · top 5,000 on PyPI
linopylinopy builds linear, integer, and quadratic…
permissive · top 15,000 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
einopsEinops provides readable tensor operations…
permissive · top 1,000 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
linear-operatorLinearOperator abstracts structured matrix…
permissive · top 5,000 on PyPI
rasterixRasterix provides tools for analyzing raster…
permissive · top 15,000 on PyPI
arviz-statsProvides statistical computations and…
permissive · top 15,000 on PyPI
spatial_imagespatial-image provides an N-dimensional spatial…
permissive · top 15,000 on PyPI
scipy-openblas32Provides pre-built OpenBLAS shared libraries…
permissive · top 15,000 on PyPI