NDArray
An ndarray is an N-dimensional array in which all elements share a common data type. It is the core data structure used by NumPy for storing and manipulating large numerical datasets. An ndarray encapsulates both the data buffer and metadata describing its shape, datatype, and memory layout.
Key attributes include shape (a tuple describing lengths along each axis), ndim (the number of axes), size
Elements are stored contiguously by default, though operations such as slicing or transpose can create views—arrays
Ndarrays are created from Python sequences with array or asarray, or via factory helpers such as zeros,
Broadcasting allows arithmetic between arrays of different shapes under compatibility rules, enabling operations without explicit replication
Ndarrays provide memory efficiency and speed for numerical workloads but require homogeneous element types and strides