maxframe.dataframe.Series.str.isdigit#
- Series.str.isdigit()#
检查每个字符串中的所有字符是否都是数字。
这等效于对 Series/Index 的每个元素运行 Python 字符串方法
str.isdigit()。如果字符串没有字符,则该检查返回False。参见
Series.str.isalpha检查所有字符是否都是字母。
Series.str.isnumeric检查所有字符是否都是数值。
Series.str.isalnum检查所有字符是否都是字母或数字。
Series.str.isdecimal检查所有字符是否都是十进制数。
Series.str.isspace检查所有字符是否都是空白字符。
Series.str.islower检查所有字符是否都是小写。
Series.str.isasciiCheck whether all characters are ascii.
Series.str.isupper检查所有字符是否都是大写。
Series.str.istitle检查所有字符是否都是标题格式(首字母大写)。
备注
Similar to
str.isdecimalbut also includes special digits, like superscripted and subscripted digits in unicode.The exact behavior of this method, i.e. which unicode characters are considered as digits, depends on the backend used for string operations, and there can be small differences. For example, Python considers the ³ superscript character as a digit, but not the ⅕ fraction character, while PyArrow considers both as digits. For simple (ascii) decimal numbers, the behaviour is consistent.
示例
>>> import maxframe.dataframe as md >>> s3 = md.Series(["23", "³", "⅕", ""]) >>> s3.str.isdigit().execute() 0 True 1 True 2 True 3 False dtype: bool