3.11.74. numpy.lib.iterable

numpy.lib.iterable(y)[source]

Check whether or not an object can be iterated over.

Parameters:

y : object

Input object.

Returns:

b : {0, 1}

Return 1 if the object has an iterator method or is a sequence, and 0 otherwise.

Examples

>>> np.iterable([1, 2, 3])
1
>>> np.iterable(2)
0