pandas.Series.str.isdecimal¶
Check whether all characters in each string are decimal.
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.
- return
Series or Index of bool Series or Index of boolean values with the same length as the original Series/Index.
Limitations¶
Series elements are expected to be Unicode strings. Elements cannot be NaNs.
Examples¶
import pandas as pd
from numba import njit
@njit
def series_str_isdecimal():
series = pd.Series(['23', '³', '⅕', ''])
out_series = series.str.isdecimal()
return out_series # Expect series of True, False, False, False
print(series_str_isdecimal())
$ python ./series/str/series_str_isdecimal.py
0 True
1 False
2 False
3 False
dtype: bool
See also
- Series.str.isalpha
Checks whether all characters are alphabetic.
- Series.str.isnumeric
Checks whether all characters are numeric.
- Series.str.isalnum
Checks whether all characters are alphanumeric.
- Series.str.isdigit
Checks whether all characters are digits.
- Series.str.isdecimal
Checks whether all characters are decimal.
- Series.str.isspace
Checks whether all characters are whitespace.
- Series.str.islower
Checks whether all characters are lowercase.
- Series.str.isupper
Checks whether all characters are uppercase.
- Series.str.istitle
Checks whether all characters are titlecase.