pandas.Series.str.isdecimal#
- Series.str.isdecimal()[source]#
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,Falseis 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
Series.str.isalphaCheck whether all characters are alphabetic.
Series.str.isnumericCheck whether all characters are numeric.
Series.str.isalnumCheck whether all characters are alphanumeric.
Series.str.isdigitCheck whether all characters are digits.
Series.str.isspaceCheck whether all characters are whitespace.
Series.str.islowerCheck whether all characters are lowercase.
Series.str.isasciiCheck whether all characters are ascii.
Series.str.isupperCheck whether all characters are uppercase.
Series.str.istitleCheck whether all characters are titlecase.
Examples
The
s3.str.isdecimalmethod checks for characters used to form numbers in base 10.>>> s3 = pd.Series(['23', '³', '⅕', '']) >>> s3.str.isdecimal() 0 True 1 False 2 False 3 False dtype: bool