Join the variable name and index xarray coordinate multidimensional array in NumPy

xarray is an open source Python package, it can make the process a multidimensional array is more simple, efficient and fun. xarray the introduction of variable names and coordinates of the index tag of the original class NumPy multidimensional array to achieve a more intuitive, more concise and more error-prone ability. The package includes a large and growing domain-independent libraries for the use of these data structures for advanced analysis and visualization. xarray inspiration from the same data analysis tasks to solve born pandas.

Multidimensional array (tensor) is an important part of computing science, they cover a wide range of fields, including physics, astronomy, earth science, bioinformatics, engineering, finance and depth of learning. In Python, NumPy provides the basic data structures and API for processing raw multidimensional arrays, but the real-world data sets are usually not just the raw data, they have a label for how to code about array values ​​are mapped to space, time information and other locations. So there have xarray this project, it introduces a variable name and coordinates of the index tag of the original class NumPy multidimensional array to achieve a more intuitive, more concise and more error-prone ability.

characteristic:

  • Multidimensional arrays operating variable names, such as: x.sum ( 'time')
  • Instead of the position selected by the tag value: x.loc [ '2014-01-01'] or x.sel (time = '2014-01-01')
  • Dimension name instead of a shape based on mathematical calculation on a multidimensional array vectoring
  • Flexible groupby split-apply-combine operation: x.groupby ( 'time.dayofyear') mean ().
  • Based database (e.g. alignment) coordinates of the label can be smoothly handle missing values: x, y = xr.align (x, y, join = 'outer')
  • In the form of a Python dictionary of tracking arbitrary metadata: x.attrs

Guess you like

Origin www.cnblogs.com/fewfwf/p/11832554.html