python有趣的库_xarray 是一个开源 Python 包,让多维数组处理更加简单、高效并有趣...

xarray: N-D labeled arrays and datasets

68747470733a2f2f6465762e617a7572652e636f6d2f7861727261792f7861727261792f5f617069732f6275696c642f7374617475732f7079646174612e7861727261793f6272616e63684e616d653d6d6173746572

68747470733a2f2f636f6465636f762e696f2f67682f7079646174612f7861727261792f6272616e63682f6d61737465722f67726170682f62616467652e737667

68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f787261792f62616467652f3f76657273696f6e3d6c6174657374

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f62656e63686d61726b656425323062792d6173762d677265656e2e7376673f7374796c653d666c6174

68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f7861727261792e737667

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.

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://xarray.pydata.org/

Contributing

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

Get in touch

Ask usage questions ("How do I?") on StackOverflow.

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

68747470733a2f2f6e756d666f6375732e6f72672f77702d636f6e74656e742f75706c6f6164732f323031372f30372f4e756d466f6375735f4c52472e706e67

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.

License

Copyright 2014-2019, 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

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.

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值