pyspark.pandas.Series.str.isdecimal

str.isdecimal() → ps.Series

Check whether all characters in each string are decimals.

This is equivalent to running the Python string method str.isdecimal() for each element of the Series/Index. If a string has zero characters, False is returned for that check.

Examples

>>> s = ps.Series(['23', '³', '⅕', ''])

The s.str.isdecimal method checks for characters used to form numbers in base 10.

>>> s.str.isdecimal()
0     True
1    False
2    False
3    False
dtype: bool

The s.str.isdigit method is the same as s.str.isdecimal but also includes special digits, like superscripted and subscripted digits in unicode.

>>> s.str.isdigit()
0     True
1     True
2    False
3    False
dtype: bool

The s.str.isnumeric method is the same as s.str.isdigit but also includes other characters that can represent quantities such as unicode fractions.

>>> s.str.isnumeric()
0     True
1     True
2     True
3    False
dtype: bool