cudf.core.accessors.string.StringMethods.isnumeric#
- StringMethods.isnumeric() Series | Index[source]#
Check whether all characters in each string are numeric.
This is equivalent to running the Python string method str.isnumeric() for each element of the Series/Index. If a string has zero characters, False is returned for that check.
- Returns:
- Series or Index of bool
Series or Index of boolean values with the same length as the original Series/Index.
See also
isalnumCheck whether all characters are alphanumeric.
isalphaCheck whether all characters are alphabetic.
isdecimalCheck whether all characters are decimal.
isdigitCheck whether all characters are digits.
isintegerCheck whether all characters are integer.
isfloatCheck whether all characters are float.
islowerCheck whether all characters are lowercase.
isspaceCheck whether all characters are whitespace.
isupperCheck whether all characters are uppercase.
Examples
>>> import cudf >>> s1 = cudf.Series(['one', 'one1', '1', '']) >>> s1.str.isnumeric() 0 False 1 False 2 True 3 False dtype: bool
The
s1.str.isnumericmethod is the same ass2.str.isdigitbut also includes other characters that can represent quantities such as unicode fractions.>>> s2 = pd.Series(['23', '³', '⅕', ''], dtype='str') >>> s2.str.isnumeric() 0 True 1 True 2 True 3 False dtype: bool