📖 INDEX
LOADING ENGINE...
ndarray.ndim
AI & DATA SCIENCE // ndarray-ndim
Number of array dimensions (axes).
Syntax
print(arr.ndim) # e.g., 2Examples
Example 01Basic Usage
print(arr.ndim) # e.g., 2Best Practices
- Refer to the official NumPy documentation for deep vectorization techniques.
- Avoid writing custom Python for-loops for operations that can be vectorized with NumPy.