1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
- Metadata-Version: 2.1
- Name: xarray
- Version: 2023.12.0
- Summary: N-D labeled arrays and datasets in Python
- Author-email: xarray Developers <xarray@googlegroups.com>
- License: Apache-2.0
- Project-URL: Documentation, https://docs.xarray.dev
- Project-URL: SciPy2015-talk, https://www.youtube.com/watch?v=X0pAhJgySxk
- Project-URL: homepage, https://xarray.dev/
- Project-URL: issue-tracker, https://github.com/pydata/xarray/issues
- Project-URL: source-code, https://github.com/pydata/xarray
- Classifier: Development Status :: 5 - Production/Stable
- Classifier: License :: OSI Approved :: Apache Software License
- Classifier: Operating System :: OS Independent
- Classifier: Intended Audience :: Science/Research
- Classifier: Programming Language :: Python
- Classifier: Programming Language :: Python :: 3
- Classifier: Programming Language :: Python :: 3.9
- Classifier: Programming Language :: Python :: 3.10
- Classifier: Programming Language :: Python :: 3.11
- Classifier: Topic :: Scientific/Engineering
- Requires-Python: >=3.9
- Description-Content-Type: text/markdown
- License-File: LICENSE
- Requires-Dist: numpy >=1.22
- Requires-Dist: packaging >=21.3
- Requires-Dist: pandas >=1.4
- Provides-Extra: accel
- Requires-Dist: scipy ; extra == 'accel'
- Requires-Dist: bottleneck ; extra == 'accel'
- Requires-Dist: numbagg ; extra == 'accel'
- Requires-Dist: flox ; extra == 'accel'
- Requires-Dist: opt-einsum ; extra == 'accel'
- Provides-Extra: complete
- Requires-Dist: xarray[accel,io,parallel,viz] ; extra == 'complete'
- Provides-Extra: io
- Requires-Dist: netCDF4 ; extra == 'io'
- Requires-Dist: h5netcdf ; extra == 'io'
- Requires-Dist: scipy ; extra == 'io'
- Requires-Dist: zarr ; extra == 'io'
- Requires-Dist: fsspec ; extra == 'io'
- Requires-Dist: cftime ; extra == 'io'
- Requires-Dist: pooch ; extra == 'io'
- Requires-Dist: pydap ; (python_version < "3.10") and extra == 'io'
- Provides-Extra: parallel
- Requires-Dist: dask[complete] ; extra == 'parallel'
- Provides-Extra: viz
- Requires-Dist: matplotlib ; extra == 'viz'
- Requires-Dist: seaborn ; extra == 'viz'
- Requires-Dist: nc-time-axis ; extra == 'viz'
- # xarray: N-D labeled arrays and datasets
- [](https://github.com/pydata/xarray/actions?query=workflow%3ACI)
- [](https://codecov.io/gh/pydata/xarray)
- [](https://docs.xarray.dev/)
- [](https://pandas.pydata.org/speed/xarray/)
- [](https://pypi.python.org/pypi/xarray/)
- [](https://github.com/python/black)
- [](http://mypy-lang.org/)
- [](https://doi.org/10.5281/zenodo.598201)
- [](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/weather-data.ipynb)
- [](https://twitter.com/xarray_dev)
- **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](https://www.numpy.org)-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](https://pandas.pydata.org), the popular data analysis package
- focused on labelled tabular data. It is particularly tailored to working
- with [netCDF](https://www.unidata.ucar.edu/software/netcdf) files, which
- were the source of xarray\'s data model, and integrates tightly with
- [dask](https://dask.org) 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](https://www.numpy.org) 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](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/weather-data.ipynb).
- ## Contributing
- You can find information about contributing to xarray at our
- [Contributing
- page](https://docs.xarray.dev/en/stable/contributing.html).
- ## Get in touch
- - Ask usage questions ("How do I?") on
- [GitHub Discussions](https://github.com/pydata/xarray/discussions).
- - Report bugs, suggest features or view the source code [on
- GitHub](https://github.com/pydata/xarray).
- - For less well defined questions or ideas, or to announce other
- projects of interest to xarray users, use the [mailing
- list](https://groups.google.com/forum/#!forum/xarray).
- ## NumFOCUS
- <img src="https://numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png" width="200" href="https://numfocus.org/">
- Xarray is a fiscally sponsored project of
- [NumFOCUS](https://numfocus.org), 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](https://numfocus.salsalabs.org/donate-to-xarray/) to support
- our efforts.
- ## History
- Xarray is an evolution of an internal tool developed at [The Climate
- Corporation](http://climate.com/). 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](https://numfocus.org) in August 2018.
- ## Contributors
- Thanks to our many contributors!
- [](https://github.com/pydata/xarray/graphs/contributors)
- ## License
- Copyright 2014-2023, 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.
|