numpy.char.isdigit#

char.isdigit(a)[source]#

Returns true for each element if all characters in the string are digits and there is at least one character, false otherwise.

Calls str.isdigit element-wise.

For 8-bit strings, this method is locale-dependent.

Parameters:
aarray_like of str or unicode
Returns:
outndarray

Output array of bools

See also

str.isdigit

Examples

>>> a = np.array(['a', 'b', '0'])
>>> np.char.isdigit(a)
array([False, False,  True])
>>> a = np.array([['a', 'b', '0'], ['c', '1', '2']])
>>> np.char.isdigit(a)
array([[False, False,  True], [False,  True,  True]])