pyspark.pandas.Series.str.isnumeric

str。 isnumeric ( )→pyspark.pandas.series.Series

檢查是否每個字符串中所有的人物都是數字。

這相當於運行Python字符串方法str.isnumeric ()為每個元素的係列/索引。如果一個字符串是零字符,返回錯誤檢查。

例子

> > >s1=ps係列([“一個”,“one1”,' 1 ',])> > >s1strisnumeric()0錯誤1假2真3錯誤dtype: bool
> > >s2=ps係列([“23”,“³”,“⅕”,])

s2.str。isdecimalmethod checks for characters used to form numbers in base 10.

> > >s2strisdecimal()0真實1假2錯誤3錯誤dtype: bool

s2.str。isdigitmethod is the same as s2.str.isdecimal but also includes special digits, like superscripted and subscripted digits in unicode.

> > >s2strisdigit()0真實1真正的2錯誤3錯誤dtype: bool

s2.str。isnumericmethod is the same as s2.str.isdigit but also includes other characters that can represent quantities such as unicode fractions.

> > >s2strisnumeric()0真實1真正的2真3錯誤dtype: bool