MCPcopy Create free account
hub / github.com/numpy/numpy / isdigit

Function isdigit

numpy/core/defchararray.py:872–903  ·  view source on GitHub ↗

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 ---------- a : array_like of str or unicode

(a)

Source from the content-addressed store, hash-verified

870
871@array_function_dispatch(_unary_op_dispatcher)
872def isdigit(a):
873 """
874 Returns true for each element if all characters in the string are
875 digits and there is at least one character, false otherwise.
876
877 Calls `str.isdigit` element-wise.
878
879 For 8-bit strings, this method is locale-dependent.
880
881 Parameters
882 ----------
883 a : array_like of str or unicode
884
885 Returns
886 -------
887 out : ndarray
888 Output array of bools
889
890 See Also
891 --------
892 str.isdigit
893
894 Examples
895 --------
896 >>> a = np.array(['a', 'b', '0'])
897 >>> np.char.isdigit(a)
898 array([False, False, True])
899 >>> a = np.array([['a', 'b', '0'], ['c', '1', '2']])
900 >>> np.char.isdigit(a)
901 array([[False, False, True], [False, True, True]])
902 """
903 return _vec_string(a, bool_, 'isdigit')
904
905
906@array_function_dispatch(_unary_op_dispatcher)

Callers 7

isdigitMethod · 0.85
parse_iso_8601_datetimeFunction · 0.85
str_to_int64Function · 0.85
str_to_uint64Function · 0.85
ensure_decimal_pointFunction · 0.85

Calls 1

_vec_stringFunction · 0.90

Tested by

no test coverage detected