arkouda.numpy.char

Functions

isnumeric(→ arkouda.numpy.pdarrayclass.pdarray)

Return a boolean pdarray where index i indicates whether string i of the

Module Contents

arkouda.numpy.char.isnumeric(pda) arkouda.numpy.pdarrayclass.pdarray[source]

Return a boolean pdarray where index i indicates whether string i of the Strings has all numeric characters. There are 1922 unicode characters that qualify as numeric, including the digits 0 through 9, superscripts and subscripted digits, special characters with the digits encircled or enclosed in parens, “vulgar fractions,” and more.

Returns:

True for elements that are numerics, False otherwise

Return type:

pdarray

Raises:
  • RuntimeError – Raised if there is a server-side error thrown

  • TypeError – Raised if the input is not a Strings type

See also

Strings.isdecimal

Examples

>>> import arkouda as ak
>>> not_numeric = ak.array([f'Strings {i}' for i in range(3)])
>>> numeric = ak.array([f'12{i}' for i in range(3)])
>>> strings = ak.concatenate([not_numeric, numeric])
>>> strings
array(['Strings 0', 'Strings 1', 'Strings 2', '120', '121', '122'])
>>> ak.isnumeric(strings)
array([False False False True True True])

Special Character Examples

>>> special_strings = ak.array(["3.14", "0", "²", "2³₇", "2³x₇"])
>>> special_strings
array(['3.14', '0', '²', '2³₇', '2³x₇'])
>>> ak.isnumeric(special_strings)
array([False True True True False])