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)
| 870 | |
| 871 | @array_function_dispatch(_unary_op_dispatcher) |
| 872 | def 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) |
no test coverage detected