Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

1ada004c-0968-4c09-b3e6-467b434ee6af 11 KB
Raw

You have to be logged in to leave a comment. Sign In
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
  1. Metadata-Version: 2.1
  2. Name: xarray
  3. Version: 2023.12.0
  4. Summary: N-D labeled arrays and datasets in Python
  5. Author-email: xarray Developers <xarray@googlegroups.com>
  6. License: Apache-2.0
  7. Project-URL: Documentation, https://docs.xarray.dev
  8. Project-URL: SciPy2015-talk, https://www.youtube.com/watch?v=X0pAhJgySxk
  9. Project-URL: homepage, https://xarray.dev/
  10. Project-URL: issue-tracker, https://github.com/pydata/xarray/issues
  11. Project-URL: source-code, https://github.com/pydata/xarray
  12. Classifier: Development Status :: 5 - Production/Stable
  13. Classifier: License :: OSI Approved :: Apache Software License
  14. Classifier: Operating System :: OS Independent
  15. Classifier: Intended Audience :: Science/Research
  16. Classifier: Programming Language :: Python
  17. Classifier: Programming Language :: Python :: 3
  18. Classifier: Programming Language :: Python :: 3.9
  19. Classifier: Programming Language :: Python :: 3.10
  20. Classifier: Programming Language :: Python :: 3.11
  21. Classifier: Topic :: Scientific/Engineering
  22. Requires-Python: >=3.9
  23. Description-Content-Type: text/markdown
  24. License-File: LICENSE
  25. Requires-Dist: numpy >=1.22
  26. Requires-Dist: packaging >=21.3
  27. Requires-Dist: pandas >=1.4
  28. Provides-Extra: accel
  29. Requires-Dist: scipy ; extra == 'accel'
  30. Requires-Dist: bottleneck ; extra == 'accel'
  31. Requires-Dist: numbagg ; extra == 'accel'
  32. Requires-Dist: flox ; extra == 'accel'
  33. Requires-Dist: opt-einsum ; extra == 'accel'
  34. Provides-Extra: complete
  35. Requires-Dist: xarray[accel,io,parallel,viz] ; extra == 'complete'
  36. Provides-Extra: io
  37. Requires-Dist: netCDF4 ; extra == 'io'
  38. Requires-Dist: h5netcdf ; extra == 'io'
  39. Requires-Dist: scipy ; extra == 'io'
  40. Requires-Dist: zarr ; extra == 'io'
  41. Requires-Dist: fsspec ; extra == 'io'
  42. Requires-Dist: cftime ; extra == 'io'
  43. Requires-Dist: pooch ; extra == 'io'
  44. Requires-Dist: pydap ; (python_version < "3.10") and extra == 'io'
  45. Provides-Extra: parallel
  46. Requires-Dist: dask[complete] ; extra == 'parallel'
  47. Provides-Extra: viz
  48. Requires-Dist: matplotlib ; extra == 'viz'
  49. Requires-Dist: seaborn ; extra == 'viz'
  50. Requires-Dist: nc-time-axis ; extra == 'viz'
  51. # xarray: N-D labeled arrays and datasets
  52. [![CI](https://github.com/pydata/xarray/workflows/CI/badge.svg?branch=main)](https://github.com/pydata/xarray/actions?query=workflow%3ACI)
  53. [![Code coverage](https://codecov.io/gh/pydata/xarray/branch/main/graph/badge.svg?flag=unittests)](https://codecov.io/gh/pydata/xarray)
  54. [![Docs](https://readthedocs.org/projects/xray/badge/?version=latest)](https://docs.xarray.dev/)
  55. [![Benchmarked with asv](https://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat)](https://pandas.pydata.org/speed/xarray/)
  56. [![Available on pypi](https://img.shields.io/pypi/v/xarray.svg)](https://pypi.python.org/pypi/xarray/)
  57. [![Formatted with black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
  58. [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
  59. [![Mirror on zendoo](https://zenodo.org/badge/DOI/10.5281/zenodo.598201.svg)](https://doi.org/10.5281/zenodo.598201)
  60. [![Examples on binder](https://img.shields.io/badge/launch-binder-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09PX29vb39/f5+fr7+/z8/Pz9/v7+zczCxgAABC5JREFUeAHN1ul3k0UUBvCb1CTVpmpaitAGSLSpS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0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/weather-data.ipynb)
  61. [![Twitter](https://img.shields.io/twitter/follow/xarray_dev?style=social)](https://twitter.com/xarray_dev)
  62. **xarray** (pronounced "ex-array", formerly known as **xray**) is an open source project and Python
  63. package that makes working with labelled multi-dimensional arrays
  64. simple, efficient, and fun!
  65. Xarray introduces labels in the form of dimensions, coordinates and
  66. attributes on top of raw [NumPy](https://www.numpy.org)-like arrays,
  67. which allows for a more intuitive, more concise, and less error-prone
  68. developer experience. The package includes a large and growing library
  69. of domain-agnostic functions for advanced analytics and visualization
  70. with these data structures.
  71. Xarray was inspired by and borrows heavily from
  72. [pandas](https://pandas.pydata.org), the popular data analysis package
  73. focused on labelled tabular data. It is particularly tailored to working
  74. with [netCDF](https://www.unidata.ucar.edu/software/netcdf) files, which
  75. were the source of xarray\'s data model, and integrates tightly with
  76. [dask](https://dask.org) for parallel computing.
  77. ## Why xarray?
  78. Multi-dimensional (a.k.a. N-dimensional, ND) arrays (sometimes called
  79. "tensors") are an essential part of computational science. They are
  80. encountered in a wide range of fields, including physics, astronomy,
  81. geoscience, bioinformatics, engineering, finance, and deep learning. In
  82. Python, [NumPy](https://www.numpy.org) provides the fundamental data
  83. structure and API for working with raw ND arrays. However, real-world
  84. datasets are usually more than just raw numbers; they have labels which
  85. encode information about how the array values map to locations in space,
  86. time, etc.
  87. Xarray doesn\'t just keep track of labels on arrays \-- it uses them to
  88. provide a powerful and concise interface. For example:
  89. - Apply operations over dimensions by name: `x.sum('time')`.
  90. - Select values by label instead of integer location:
  91. `x.loc['2014-01-01']` or `x.sel(time='2014-01-01')`.
  92. - Mathematical operations (e.g., `x - y`) vectorize across multiple
  93. dimensions (array broadcasting) based on dimension names, not shape.
  94. - Flexible split-apply-combine operations with groupby:
  95. `x.groupby('time.dayofyear').mean()`.
  96. - Database like alignment based on coordinate labels that smoothly
  97. handles missing values: `x, y = xr.align(x, y, join='outer')`.
  98. - Keep track of arbitrary metadata in the form of a Python dictionary:
  99. `x.attrs`.
  100. ## Documentation
  101. Learn more about xarray in its official documentation at
  102. <https://docs.xarray.dev/>.
  103. Try out an [interactive Jupyter
  104. notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/weather-data.ipynb).
  105. ## Contributing
  106. You can find information about contributing to xarray at our
  107. [Contributing
  108. page](https://docs.xarray.dev/en/stable/contributing.html).
  109. ## Get in touch
  110. - Ask usage questions ("How do I?") on
  111. [GitHub Discussions](https://github.com/pydata/xarray/discussions).
  112. - Report bugs, suggest features or view the source code [on
  113. GitHub](https://github.com/pydata/xarray).
  114. - For less well defined questions or ideas, or to announce other
  115. projects of interest to xarray users, use the [mailing
  116. list](https://groups.google.com/forum/#!forum/xarray).
  117. ## NumFOCUS
  118. <img src="https://numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png" width="200" href="https://numfocus.org/">
  119. Xarray is a fiscally sponsored project of
  120. [NumFOCUS](https://numfocus.org), a nonprofit dedicated to supporting
  121. the open source scientific computing community. If you like Xarray and
  122. want to support our mission, please consider making a
  123. [donation](https://numfocus.salsalabs.org/donate-to-xarray/) to support
  124. our efforts.
  125. ## History
  126. Xarray is an evolution of an internal tool developed at [The Climate
  127. Corporation](http://climate.com/). It was originally written by Climate
  128. Corp researchers Stephan Hoyer, Alex Kleeman and Eugene Brevdo and was
  129. released as open source in May 2014. The project was renamed from
  130. "xray" in January 2016. Xarray became a fiscally sponsored project of
  131. [NumFOCUS](https://numfocus.org) in August 2018.
  132. ## Contributors
  133. Thanks to our many contributors!
  134. [![Contributors](https://contrib.rocks/image?repo=pydata/xarray)](https://github.com/pydata/xarray/graphs/contributors)
  135. ## License
  136. Copyright 2014-2023, xarray Developers
  137. Licensed under the Apache License, Version 2.0 (the "License"); you
  138. may not use this file except in compliance with the License. You may
  139. obtain a copy of the License at
  140. <https://www.apache.org/licenses/LICENSE-2.0>
  141. Unless required by applicable law or agreed to in writing, software
  142. distributed under the License is distributed on an "AS IS" BASIS,
  143. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  144. See the License for the specific language governing permissions and
  145. limitations under the License.
  146. Xarray bundles portions of pandas, NumPy and Seaborn, all of which are
  147. available under a "3-clause BSD" license:
  148. - pandas: `setup.py`, `xarray/util/print_versions.py`
  149. - NumPy: `xarray/core/npcompat.py`
  150. - Seaborn: `_determine_cmap_params` in `xarray/core/plot/utils.py`
  151. Xarray also bundles portions of CPython, which is available under the
  152. "Python Software Foundation License" in `xarray/core/pycompat.py`.
  153. Xarray uses icons from the icomoon package (free version), which is
  154. available under the "CC BY 4.0" license.
  155. The full text of these licenses are included in the licenses directory.
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...