Inspect ndim, shape, size, dtype, itemsize, nbytes, and strides memory layout.
Every ndarray contains metadata attributes that tell you its geometry, element data types, and how bytes are stepped across in memory.
Think of attributes as an array's passport: shape tells you its dimensions, dtype tells you element weight, and strides tell the CPU how many bytes to jump.
arr.shape is a tuple of dimension lengths; arr.size is total elements; arr.strides is the number of bytes to step in memory along each axis.
shape = arr.shape; strides = arr.stridesVisualize multidimensional ndarrays in full 3D space with depth, row, and column slice planes.
tensor = np.arange(10, 37).reshape(3, 3, 3)Full 3D ndarray Tensor. Shape: (3, 3, 3) • 27 elements in RAM
print(arr.shape())print(arr.shape)shape, ndim, and size are properties/attributes, not callable functions.
Solve the objective below using NumPy vectorized syntax
Create an array `arr = np.array([[1, 2, 3], [4, 5, 6]])` and print `arr.shape`.
(2, 3)