isiterable
despasito.utils.general_toolbox.isiterable
- isiterable(array)[source]
Check if variable is an iterable type with a length (e.g. np.array or list).
Note that this could be tested with
isinstance(array, Iterable), howeverarray=np.array(1.0)would pass that test and then fail inlen(array).- Parameters:
array – Variable of some type, that should be iterable
- Returns:
isiterable – Will be True if indexing is possible and False if not.
- Return type:
bool