int PyArray_NDIM()

Array API

Array structure and data access

These macros all access the PyArrayObject structure members. The input argument, arr, can be any PyObject * that is directly interpretable as a PyArrayObject * (any instance of the PyArray_Type and its sub-types).

int PyArray_NDIM(PyArrayObject *arr)

The number of dimensions in the array.

npy_intp *PyArray_DIMS(PyArrayObject *arr)

Returns a pointer to the dimensions/shape of the array.