For each element, return True if there are only decimal characters in the element. Calls `str.isdecimal` element-wise. Decimal characters include digit characters, and all characters that can be used to form decimal-radix numbers, e.g. ``U+0660, ARABIC-INDIC DIGIT ZERO``.
(a)
| 1883 | |
| 1884 | @array_function_dispatch(_unary_op_dispatcher) |
| 1885 | def isdecimal(a): |
| 1886 | """ |
| 1887 | For each element, return True if there are only decimal |
| 1888 | characters in the element. |
| 1889 | |
| 1890 | Calls `str.isdecimal` element-wise. |
| 1891 | |
| 1892 | Decimal characters include digit characters, and all characters |
| 1893 | that can be used to form decimal-radix numbers, |
| 1894 | e.g. ``U+0660, ARABIC-INDIC DIGIT ZERO``. |
| 1895 | |
| 1896 | Parameters |
| 1897 | ---------- |
| 1898 | a : array_like, unicode |
| 1899 | Input array. |
| 1900 | |
| 1901 | Returns |
| 1902 | ------- |
| 1903 | out : ndarray, bool |
| 1904 | Array of booleans identical in shape to `a`. |
| 1905 | |
| 1906 | See Also |
| 1907 | -------- |
| 1908 | str.isdecimal |
| 1909 | |
| 1910 | Examples |
| 1911 | -------- |
| 1912 | >>> np.char.isdecimal(['12345', '4.99', '123ABC', '']) |
| 1913 | array([ True, False, False, False]) |
| 1914 | |
| 1915 | """ |
| 1916 | if not _is_unicode(a): |
| 1917 | raise TypeError( |
| 1918 | "isdecimal is only available for Unicode strings and arrays") |
| 1919 | return _vec_string(a, bool_, 'isdecimal') |
| 1920 | |
| 1921 | |
| 1922 | @set_module('numpy') |
no test coverage detected