Stats, linear algebra and einops for xarray
Project description
xarray-einstats
Stats, linear algebra and einops for xarray
Installation
To install, run
(.venv) $ pip install xarray-einstats
See the docs for more extensive install instructions.
Overview
As stated in their website:
xarray makes working with multi-dimensional labeled arrays simple, efficient and fun!
The code is often more verbose, but it is generally because it is clearer and thus less error prone and more intuitive. Here are some examples of such trade-off where we believe the increased clarity is worth the extra characters:
numpy | xarray |
---|---|
a[2, 5] |
da.sel(drug="paracetamol", subject=5) |
a.mean(axis=(0, 1)) |
da.mean(dim=("chain", "draw")) |
a.reshape((-1, 10)) |
da.stack(sample=("chain", "draw")) |
a.transpose(2, 0, 1) |
da.transpose("drug", "chain", "draw") |
In some other cases however, using xarray can result in overly verbose code
that often also becomes less clear. xarray_einstats
provides wrappers
around some numpy and scipy functions (mostly numpy.linalg
and scipy.stats
)
and around einops with an api and features adapted to xarray.
Continue at the getting started page.
Contributing
xarray-einstats is in active development and all types of contributions are welcome! See the contributing guide for details on how to contribute.
Relevant links
- Documentation: https://einstats.python.arviz.org/en/latest/
- Contributing guide: https://einstats.python.arviz.org/en/latest/contributing/overview.html
- ArviZ project website: https://www.arviz.org
Similar projects
Here we list some similar projects we know of. Note that all of them are complementary and don't overlap:
Cite xarray-einstats
If you use this software, please cite it using the following template and the version specific DOI provided by Zenodo. Click on the badge to go to the Zenodo page and select the DOI corresponding to the version you used
- Oriol Abril-Pla. (2022). arviz-devs/xarray-einstats
<version>
. Zenodo.<version_doi>
or in bibtex format:
@software{xarray_einstats2022,
author = {Abril-Pla, Oriol},
title = {{xarray-einstats}},
year = 2022,
url = {https://github.com/arviz-devs/xarray-einstats}
publisher = {Zenodo},
version = {<version>},
doi = {<version_doi>},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file xarray_einstats-0.8.0.tar.gz
.
File metadata
- Download URL: xarray_einstats-0.8.0.tar.gz
- Upload date:
- Size: 30.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f1573f9bd4d60d6e7ed9fd27c4db39da51ec49bf8ba654d4602a139a6309d7f |
|
MD5 | 21f67758fb509cb5e77925bcddc5a957 |
|
BLAKE2b-256 | ed5d654cca0448ad5c1d0333530511bc20eefaab304a4362dcbdc7ea3da12a3d |
File details
Details for the file xarray_einstats-0.8.0-py3-none-any.whl
.
File metadata
- Download URL: xarray_einstats-0.8.0-py3-none-any.whl
- Upload date:
- Size: 32.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd00552c3fb5c859b1ebc7c88a97342d3bb93d14bba904c5a9b94a4f724b76b4 |
|
MD5 | 9828848e07f833ef894bd5ea94a9f5a5 |
|
BLAKE2b-256 | f80727f0d68989bb1c44a781747e222dda67cf65002834ed35ad91abd1a71802 |