nums.numpy.ndim

nums.numpy.ndim(a)[source]

Return the number of dimensions of an array.

This docstring was copied from numpy.ndim.

Some inconsistencies with the NumS version may exist.

Parameters

a (BlockArray) – Input array. If it is not already an BlockArray, a conversion is attempted.

Returns

number_of_dimensions – The number of dimensions in a. Scalars are zero-dimensional.

Return type

int

See also

shape

dimensions of array

Examples

The doctests shown below are copied from NumPy. They won’t show the correct result until you operate get().

>>> nps.ndim(nps.array([[1,2,3],[4,5,6]])).get()  
2