pandas.Series.str.isnumeric#

Series.str.isnumeric()[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

Series.str.isalpha

Check whether all characters are alphabetic.

Series.str.isalnum

Check whether all characters are alphanumeric.

Series.str.isdigit

Check whether all characters are digits.

Series.str.isdecimal

Check whether all characters are decimal.

Series.str.isspace

Check whether all characters are whitespace.

Series.str.islower

Check whether all characters are lowercase.

Series.str.isupper

Check whether all characters are uppercase.

Series.str.istitle

Check whether all characters are titlecase.

Examples

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

>>> s1 = pd.Series(['one', 'one1', '1', ''])
>>> s1.str.isnumeric()
0    False
1    False
2     True
3    False
dtype: bool