Array objects#
NumPy provides an N-dimensional array type, thendarray, which describes a collection of “items” of the sametype. The items can beindexed using forexample N integers.
All ndarrays arehomogeneous: every item takes up the same sizeblock of memory, and all blocks are interpreted in exactly the sameway. How each item in the array is to be interpreted is specified by aseparatedata-type object, one of which is associatedwith 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 representedby a Python object whose type is one of thearray scalar types built in NumPy. The array scalars allow easy manipulationof also more complicated arrangements of data.

FigureConceptual diagram showing the relationship between the threefundamental objects used to describe the data in an array: 1) thendarray itself, 2) the data-type object that describes the layoutof a single fixed-size element of the array, 3) the array-scalarPython object that is returned when a single element of the arrayis accessed.#