A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

xarray

An open source project and Python package that introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, which allows for more intuitive, more concise, and less error-prone user experience.
https://github.com/pydata/xarray

Category: Climate Change
Sub Category: Climate Data Standards

Keywords

dask netcdf numpy pandas python xarray

Keywords from Contributors

pydata closember flexible alignment climate notebooks qt meteorology gtk spec-0

Last synced: about 11 hours ago
JSON representation

Repository metadata

N-D labeled arrays and datasets in Python

README.md

xarray: N-D labeled arrays and datasets

CI
Code coverage
Docs
Benchmarked with asv
Formatted with black
Checked with mypy
Available on pypi
PyPI - Downloads
Conda - Downloads
DOI
Examples on binder
Twitter

xarray (pronounced "ex-array", formerly known as xray) is an open source project and Python
package that makes working with labelled multi-dimensional arrays
simple, efficient, and fun!

Xarray introduces labels in the form of dimensions, coordinates and
attributes on top of raw NumPy-like arrays,
which allows for a more intuitive, more concise, and less error-prone
developer experience. The package includes a large and growing library
of domain-agnostic functions for advanced analytics and visualization
with these data structures.

Xarray was inspired by and borrows heavily from
pandas, the popular data analysis package
focused on labelled tabular data. It is particularly tailored to working
with netCDF files, which
were the source of xarray's data model, and integrates tightly with
dask for parallel computing.

Why xarray?

Multi-dimensional (a.k.a. N-dimensional, ND) arrays (sometimes called
"tensors") are an essential part of computational science. They are
encountered in a wide range of fields, including physics, astronomy,
geoscience, bioinformatics, engineering, finance, and deep learning. In
Python, NumPy provides the fundamental data
structure and API for working with raw ND arrays. However, real-world
datasets are usually more than just raw numbers; they have labels which
encode information about how the array values map to locations in space,
time, etc.

Xarray doesn't just keep track of labels on arrays -- it uses them to
provide a powerful and concise interface. For example:

  • Apply operations over dimensions by name: x.sum('time').
  • Select values by label instead of integer location:
    x.loc['2014-01-01'] or x.sel(time='2014-01-01').
  • Mathematical operations (e.g., x - y) vectorize across multiple
    dimensions (array broadcasting) based on dimension names, not shape.
  • Flexible split-apply-combine operations with groupby:
    x.groupby('time.dayofyear').mean().
  • Database like alignment based on coordinate labels that smoothly
    handles missing values: x, y = xr.align(x, y, join='outer').
  • Keep track of arbitrary metadata in the form of a Python dictionary:
    x.attrs.

Documentation

Learn more about xarray in its official documentation at
https://docs.xarray.dev/.

Try out an interactive Jupyter
notebook
.

Contributing

You can find information about contributing to xarray at our
Contributing
page
.

Get in touch

  • Ask usage questions ("How do I?") on
    GitHub Discussions.
  • Report bugs, suggest features or view the source code on
    GitHub
    .
  • For less well defined questions or ideas, or to announce other
    projects of interest to xarray users, use the mailing
    list
    .

NumFOCUS

Xarray is a fiscally sponsored project of
NumFOCUS, a nonprofit dedicated to supporting
the open source scientific computing community. If you like Xarray and
want to support our mission, please consider making a
donation to support
our efforts.

History

Xarray is an evolution of an internal tool developed at The Climate
Corporation
. It was originally written by Climate
Corp researchers Stephan Hoyer, Alex Kleeman and Eugene Brevdo and was
released as open source in May 2014. The project was renamed from
"xray" in January 2016. Xarray became a fiscally sponsored project of
NumFOCUS in August 2018.

Contributors

Thanks to our many contributors!

Contributors

License

Copyright 2014-2024, xarray Developers

Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Xarray bundles portions of pandas, NumPy and Seaborn, all of which are
available under a "3-clause BSD" license:

  • pandas: setup.py, xarray/util/print_versions.py
  • NumPy: xarray/core/npcompat.py
  • Seaborn: _determine_cmap_params in xarray/core/plot/utils.py

Xarray also bundles portions of CPython, which is available under the
"Python Software Foundation License" in xarray/core/pycompat.py.

Xarray uses icons from the icomoon package (free version), which is
available under the "CC BY 4.0" license.

The full text of these licenses are included in the licenses directory.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: "Hoyer"
    given-names: "Stephan"
    orcid: "https://orcid.org/0000-0002-5207-0380"
  - family-names: "Roos"
    given-names: "Maximilian"
  - family-names: "Joseph"
    given-names: "Hamman"
    orcid: "https://orcid.org/0000-0001-7479-8439"
  - family-names: "Magin"
    given-names: "Justus"
    orcid: "https://orcid.org/0000-0002-4254-8002"
  - family-names: "Cherian"
    given-names: "Deepak"
    orcid: "https://orcid.org/0000-0002-6861-8734"
  - family-names: "Fitzgerald"
    given-names: "Clark"
    orcid: "https://orcid.org/0000-0003-3446-6389"
  - family-names: "Hauser"
    given-names: "Mathias"
    orcid: "https://orcid.org/0000-0002-0057-4878"
  - family-names: "Fujii"
    given-names: "Keisuke"
    orcid: "https://orcid.org/0000-0003-0390-9984"
  - family-names: "Maussion"
    given-names: "Fabien"
    orcid: "https://orcid.org/0000-0002-3211-506X"
  - family-names: "Imperiale"
    given-names: "Guido"
  - family-names: "Clark"
    given-names: "Spencer"
    orcid: "https://orcid.org/0000-0001-5595-7895"
  - family-names: "Kleeman"
    given-names: "Alex"
  - family-names: "Nicholas"
    given-names: "Thomas"
    orcid: "https://orcid.org/0000-0002-2176-0530"
  - family-names: "Kluyver"
    given-names: "Thomas"
    orcid: "https://orcid.org/0000-0003-4020-6364"
  - family-names: "Westling"
    given-names: "Jimmy"
  - family-names: "Munroe"
    given-names: "James"
    orcid: "https://orcid.org/0000-0001-9098-6309"
  - family-names: "Amici"
    given-names: "Alessandro"
    orcid: "https://orcid.org/0000-0002-1778-4505"
  - family-names: "Barghini"
    given-names: "Aureliana"
  - family-names: "Banihirwe"
    given-names: "Anderson"
    orcid: "https://orcid.org/0000-0001-6583-571X"
  - family-names: "Bell"
    given-names: "Ray"
    orcid: "https://orcid.org/0000-0003-2623-0587"
  - family-names: "Hatfield-Dodds"
    given-names: "Zac"
    orcid: "https://orcid.org/0000-0002-8646-8362"
  - family-names: "Abernathey"
    given-names: "Ryan"
    orcid: "https://orcid.org/0000-0001-5999-4917"
  - family-names: "Bovy"
    given-names: "Benoît"
  - family-names: "Omotani"
    given-names: "John"
    orcid: "https://orcid.org/0000-0002-3156-8227"
  - family-names: "Mühlbauer"
    given-names: "Kai"
    orcid: "https://orcid.org/0000-0001-6599-1034"
  - family-names: "Roszko"
    given-names: "Maximilian K."
    orcid: "https://orcid.org/0000-0001-9424-2526"
  - family-names: "Wolfram"
    given-names: "Phillip J."
    orcid: "https://orcid.org/0000-0001-5971-4241"
  - family-names: "Henderson"
    given-names: "Scott"
    orcid: "https://orcid.org/0000-0003-0624-4965"
  - family-names: "Awowale"
    given-names: "Eniola Olufunke"
  - family-names: "Scheick"
    given-names: "Jessica"
    orcid: "https://orcid.org/0000-0002-3421-4459"
  - family-names: "Savoie"
    given-names: "Matthew"
    orcid: "https://orcid.org/0000-0002-8881-2550"
  - family-names: "Littlejohns"
    given-names: "Owen"
title: "xarray"
abstract: "N-D labeled arrays and datasets in Python."
license: Apache-2.0
doi: 10.5281/zenodo.598201
url: "https://xarray.dev/"
repository-code: "https://github.com/pydata/xarray"
preferred-citation:
  type: article
  authors:
    - family-names: "Hoyer"
      given-names: "Stephan"
      orcid: "https://orcid.org/0000-0002-5207-0380"
    - family-names: "Joseph"
      given-names: "Hamman"
      orcid: "https://orcid.org/0000-0001-7479-8439"
  doi: "10.5334/jors.148"
  journal: "Journal of Open Research Software"
  month: 4
  title: "xarray: N-D labeled Arrays and Datasets in Python"
  volume: 5
  issue: 1
  year: 2017

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 5 days ago

Total Commits: 5,412
Total Committers: 541
Avg Commits per committer: 10.004
Development Distribution Score (DDS): 0.767

Commits in past year: 555
Committers in past year: 100
Avg Commits per committer in past year: 5.55
Development Distribution Score (DDS) in past year: 0.845

Name Email Commits
Stephan Hoyer s****r@c****m 1259
Maximilian Roos 5****y 390
Deepak Cherian d****n 380
keewis k****s 307
Thomas Nicholas t****s@c****u 300
Illviljan 1****n 169
Mathias Hauser m****e 127
Joe Hamman j****n@u****u 114
dependabot[bot] 4****] 98
Spencer Clark s****k@g****m 95
pre-commit-ci[bot] 6****] 95
Clark Fitzgerald c****g@g****m 88
Kai Mühlbauer k****r@u****e 74
Mick m****s@g****m 70
crusaderky c****y@g****m 69
Keisuke Fujii f****p@g****m 69
Fabien Maussion f****n@u****t 67
Joe Hamman j****1@u****u 67
Clark Fitzgerald c****d@c****m 61
Anderson Banihirwe a****e@u****u 60
Benoit Bovy b****y@g****m 47
Thomas Kluyver t****l@g****m 45
alexamici a****i@b****u 28
Ray Bell r****0@g****m 26
James Munroe j****e@m****a 25
aurghs 3****s 24
Alex Kleeman k****n@c****m 24
Dimitri Papadopoulos Orfanos 3****s 23
github-actions[bot] 4****] 20
Joe Hamman j****n@h****u 19
and 511 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 1,892
Total pull requests: 1,593
Average time to close issues: over 1 year
Average time to close pull requests: about 2 months
Total issue authors: 717
Total pull request authors: 230
Average comments per issue: 4.81
Average comments per pull request: 3.12
Merged pull request: 1,170
Bot issues: 26
Bot pull requests: 72

Past year issues: 705
Past year pull requests: 809
Past year average time to close issues: 18 days
Past year average time to close pull requests: 6 days
Past year issue authors: 252
Past year pull request authors: 118
Past year average comments per issue: 3.2
Past year average comments per pull request: 2.47
Past year merged pull request: 602
Past year bot issues: 19
Past year bot pull requests: 36

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/pydata/xarray

Top Issue Authors

  • TomNicholas (118)
  • dcherian (111)
  • max-sixty (67)
  • shoyer (61)
  • mathause (26)
  • github-actions[bot] (26)
  • benbovy (23)
  • keewis (21)
  • Illviljan (18)
  • rabernat (17)
  • eni-awowale (16)
  • flamingbear (16)
  • kmuehlbauer (15)
  • hmaarrfk (15)
  • jhamman (14)

Top Pull Request Authors

  • dcherian (210)
  • max-sixty (165)
  • Illviljan (112)
  • TomNicholas (104)
  • keewis (93)
  • kmuehlbauer (88)
  • shoyer (59)
  • benbovy (39)
  • dependabot[bot] (37)
  • andersy005 (37)
  • pre-commit-ci[bot] (35)
  • mathause (33)
  • DimitriPapadopoulos (29)
  • headtr1ck (26)
  • spencerkclark (25)

Top Issue Labels

  • bug (569)
  • enhancement (247)
  • needs triage (217)
  • topic-DataTree (181)
  • topic-backends (162)
  • topic-documentation (134)
  • topic-zarr (124)
  • usage question (98)
  • plan to close (97)
  • upstream issue (91)
  • topic-indexing (83)
  • topic-groupby (77)
  • API design (73)
  • topic-dask (65)
  • contrib-good-first-issue (54)
  • topic-CF conventions (51)
  • topic-performance (51)
  • contrib-help-wanted (48)
  • topic-arrays (43)
  • CI (42)
  • needs mcve (38)
  • topic-interpolation (38)
  • topic-typing (37)
  • topic-combine (36)
  • topic-rolling (34)
  • topic-error reporting (34)
  • topic-cftime (33)
  • design question (27)
  • regression (26)
  • topic-plotting (26)

Top Pull Request Labels

  • plan to merge (355)
  • topic-DataTree (127)
  • topic-backends (97)
  • run-upstream (97)
  • topic-documentation (83)
  • run-benchmark (65)
  • dependencies (65)
  • io (65)
  • topic-zarr (58)
  • topic-typing (54)
  • topic-groupby (44)
  • topic-indexing (41)
  • Automation (36)
  • topic-plotting (35)
  • CI (34)
  • topic-arrays (33)
  • topic-NamedArray (31)
  • topic-rolling (29)
  • topic-dask (27)
  • needs review (25)
  • topic-chunked-arrays (25)
  • topic-CF conventions (23)
  • topic-error reporting (22)
  • topic-performance (21)
  • topic-cftime (20)
  • needs work (20)
  • topic-testing (19)
  • needs triage (18)
  • run-slow-hypothesis (15)
  • Release (12)

Package metadata

pypi.org: xarray

N-D labeled arrays and datasets in Python

  • Homepage:
  • Documentation: https://docs.xarray.dev
  • Licenses: Apache-2.0
  • Latest release: 2025.3.1 (published 27 days ago)
  • Last Synced: 2025-04-25T14:41:18.858Z (1 day ago)
  • Versions: 90
  • Dependent Packages: 1,350
  • Dependent Repositories: 5,198
  • Downloads: 8,383,056 Last month
  • Docker Downloads: 19,430,565
  • Rankings:
    • Dependent packages count: 0.022%
    • Dependent repos count: 0.14%
    • Downloads: 0.164%
    • Average: 0.594%
    • Docker downloads count: 0.628%
    • Forks count: 1.266%
    • Stargazers count: 1.343%
  • Maintainers (4)
conda-forge.org: xarray

  • Homepage: https://github.com/pydata/xarray
  • Licenses: Apache-2.0
  • Latest release: 2022.11.0 (published over 2 years ago)
  • Last Synced: 2025-04-02T02:16:00.494Z (25 days ago)
  • Versions: 48
  • Dependent Packages: 345
  • Dependent Repositories: 2,401
  • Rankings:
    • Dependent packages count: 0.17%
    • Dependent repos count: 0.175%
    • Average: 3.209%
    • Forks count: 5.051%
    • Stargazers count: 7.442%
spack.io: py-xarray

N-D labeled arrays and datasets in Python

  • Homepage: https://github.com/pydata/xarray
  • Licenses: []
  • Latest release: 2024.7.0 (published 9 months ago)
  • Last Synced: 2025-04-25T14:41:18.229Z (1 day ago)
  • Versions: 11
  • Dependent Packages: 18
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Forks count: 3.029%
    • Average: 3.359%
    • Stargazers count: 4.252%
    • Dependent packages count: 6.155%
  • Maintainers (1)
pypi.org: xray

N-D labeled arrays and datasets in Python

  • Homepage: https://github.com/pydata/xarray
  • Documentation: https://xray.readthedocs.io/
  • Licenses: Apache
  • Latest release: 0.7.0 (published over 9 years ago)
  • Last Synced: 2025-04-25T14:41:18.664Z (1 day ago)
  • Versions: 17
  • Dependent Packages: 1
  • Dependent Repositories: 16
  • Downloads: 967 Last month
  • Rankings:
    • Forks count: 1.266%
    • Stargazers count: 1.343%
    • Dependent packages count: 3.271%
    • Dependent repos count: 3.668%
    • Average: 4.905%
    • Downloads: 14.975%
  • Maintainers (1)
proxy.golang.org: github.com/pydata/xarray

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/pydata/xarray#section-documentation
  • Licenses: apache-2.0
  • Latest release: v2024.11.0+incompatible (published 5 months ago)
  • Last Synced: 2025-04-25T14:41:19.334Z (1 day ago)
  • Versions: 66
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Forks count: 0.879%
    • Stargazers count: 1.234%
    • Average: 5.623%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%
anaconda.org: xarray

xarray (formerly xray) is an open source project and Python package that makes working with labelled multi-dimensional arrays simple, efficient, and fun! xarray introduces labels in the form of dimensions, coordinates and attributes on top of raw NumPy_-like arrays, which allows for a more intuitive, more concise, and less error-prone developer experience. The package includes a large and growing library of domain-agnostic functions for advanced analytics and visualization with these data structures. xarray was inspired by and borrows heavily from pandas_, the popular data analysis package focused on labelled tabular data. It is particularly tailored to working with netCDF_ files, which were the source of xarray's data model, and integrates tightly with dask_ for parallel computing.

  • Homepage: https://github.com/pydata/xarray
  • Licenses: Apache-2.0
  • Latest release: 2024.11.0 (published 4 months ago)
  • Last Synced: 2025-04-25T14:41:19.840Z (1 day ago)
  • Versions: 28
  • Dependent Packages: 18
  • Dependent Repositories: 2,401
  • Rankings:
    • Dependent repos count: 1.076%
    • Dependent packages count: 1.905%
    • Average: 7.391%
    • Forks count: 11.463%
    • Stargazers count: 15.12%
pypi.org: xarray-map

Plot xarrays lat-lon datasets using folium

  • Homepage: https://github.com/pydata/xarray
  • Documentation: https://xarray-map.readthedocs.io/
  • Licenses: Apache-2.0
  • Latest release: 0.0.2 (published about 2 years ago)
  • Last Synced: 2024-12-06T17:14:49.428Z (5 months ago)
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Forks count: 1.268%
    • Stargazers count: 1.349%
    • Dependent packages count: 7.167%
    • Average: 10.785%
    • Dependent repos count: 33.355%
pypi.org: xarrayaita

Python librairy to process AITA data

  • Homepage:
  • Documentation: https://xarrayaita.readthedocs.io/
  • Licenses: apache-2.0
  • Latest release: 0.3.3 (published 7 months ago)
  • Last Synced: 2025-04-25T14:41:19.018Z (1 day ago)
  • Versions: 15
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 439 Last month
  • Rankings:
    • Dependent packages count: 6.633%
    • Average: 18.622%
    • Dependent repos count: 30.611%
  • Maintainers (1)
pypi.org: copernicusmarine

Command line interface and Python API for accessing Copernicus Marine data and related services.

  • Homepage:
  • Documentation: https://copernicusmarine.readthedocs.io/
  • Licenses: EUPL-1.2
  • Latest release: 2.0.1 (published 2 months ago)
  • Last Synced: 2025-04-25T14:41:19.149Z (1 day ago)
  • Versions: 36
  • Dependent Packages: 7
  • Dependent Repositories: 0
  • Downloads: 17,238 Last month
  • Rankings:
    • Stargazers count: 1.685%
    • Forks count: 4.067%
    • Dependent packages count: 9.972%
    • Average: 20.388%
    • Dependent repos count: 65.826%
  • Maintainers (1)
pypi.org: xarray-jax

  • Homepage:
  • Documentation: https://xarray-jax.readthedocs.io/
  • Licenses: apache-2.0
  • Latest release: 0.0.5 (published 7 months ago)
  • Last Synced: 2025-04-25T14:41:18.244Z (1 day ago)
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 266 Last month
  • Rankings:
    • Dependent packages count: 10.298%
    • Average: 34.128%
    • Dependent repos count: 57.959%
  • Maintainers (1)

Dependencies

.github/workflows/benchmarks.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • mamba-org/provision-with-micromamba v14 composite
.github/workflows/ci-additional.yaml actions
  • actions/checkout v3 composite
  • codecov/codecov-action v3.1.1 composite
  • mamba-org/provision-with-micromamba v14 composite
  • xarray-contrib/ci-trigger v1 composite
.github/workflows/ci.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • codecov/codecov-action v3.1.1 composite
  • mamba-org/provision-with-micromamba v14 composite
  • xarray-contrib/ci-trigger v1 composite
.github/workflows/publish-test-results.yaml actions
  • EnricoMi/publish-unit-test-result-action v2 composite
.github/workflows/pypi-release.yaml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • pypa/gh-action-pypi-publish v1.6.4 composite
.github/workflows/upstream-dev-ci.yaml actions
  • actions/checkout v3 composite
  • mamba-org/provision-with-micromamba v14 composite
  • xarray-contrib/ci-trigger v1 composite
  • xarray-contrib/issue-from-pytest-log v1 composite
.github/workflows/benchmarks-last-release.yml actions
  • WyriHaximus/github-action-get-previous-tag v1 composite
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • mamba-org/setup-micromamba v1 composite
.github/workflows/nightly-wheels.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • scientific-python/upload-nightly-action main composite
pyproject.toml pypi
setup.py pypi
.binder/environment.yml conda
  • boto3
  • bottleneck
  • cartopy
  • cfgrib
  • cftime
  • coveralls
  • dask
  • dask_labextension
  • distributed
  • h5netcdf
  • h5py
  • hdf5
  • iris
  • lxml
  • matplotlib
  • nc-time-axis
  • netcdf4
  • numba
  • numbagg
  • numpy
  • packaging
  • pandas
  • pint >=0.22
  • pip
  • pooch
  • pydap
  • pynio
  • python 3.10.*
  • rasterio
  • scipy
  • seaborn
  • setuptools
  • sparse
  • toolz
  • xarray
  • zarr
ci/requirements/environment.yml conda
  • aiobotocore
  • boto3
  • bottleneck
  • cartopy
  • cftime
  • dask-core
  • distributed
  • flox
  • fsspec !=2021.7.0
  • h5netcdf
  • h5py
  • hdf5
  • hypothesis
  • iris
  • lxml
  • matplotlib-base
  • nc-time-axis
  • netcdf4
  • numba
  • numbagg
  • numexpr
  • numpy
  • opt_einsum
  • packaging
  • pandas
  • pint >=0.22
  • pip
  • pooch
  • pre-commit
  • pydap
  • pytest
  • pytest-cov
  • pytest-env
  • pytest-timeout
  • pytest-xdist
  • rasterio
  • scipy
  • seaborn
  • sparse
  • toolz
  • typing_extensions
  • zarr

Score: 31.95156836248149