ndim
-
ketos.utils.ndim(a)[source]
Returns the number of dimensions of a list/tuple/array.
- Args:
- a: list, tuple or numpy array
Object that we wish to obtain the dimension of
- Returns:
- n: int
Number of dimensions
- Example:
>>> from ketos.utils import ndim
>>>
>>> x = [[0, 1, 2, 3],(4, 5)]
>>> print(ndim(x))
2