Array(数组)对象

NumPy提供了一个N维数组类型,ndarray,它描述了相同类型的“item”的集合。 这些item可以使用N个整数进行 索引

所有的ndarrays都是同质的:每个项目占用相同大小的内存块,所有的块都以完全相同的方式解释。 How each item in the array is to be interpreted is specified by a separate data-type object, one of which is associated with every array. In addition to basic types (integers, floats, etc.), the data type objects can also represent data structures.

An item extracted from an array, e.g., by indexing, is represented by a Python object whose type is one of the array scalar types built in NumPy. The array scalars allow easy manipulation of also more complicated arrangements of data.

../_images/threefundamental.png

Figure Conceptual diagram showing the relationship between the three fundamental objects used to describe the data in an array: 1) the ndarray itself, 2) the data-type object that describes the layout of a single fixed-size element of the array, 3) the array-scalar Python object that is returned when a single element of the array is accessed.