pyspark.pandas.Series.str.isnumeric¶
-
str。
isnumeric
( )→pyspark.pandas.series.Series¶ -
檢查是否每個字符串中所有的人物都是數字。
這相當於運行Python字符串方法
str.isnumeric ()
為每個元素的係列/索引。如果一個字符串是零字符,返回錯誤檢查。例子
> > >s1=ps。係列([“一個”,“one1”,' 1 ',”])> > >s1。str。isnumeric()0錯誤1假2真3錯誤dtype: bool
> > >s2=ps。係列([“23”,“³”,“⅕”,”])
s2.str。isdecimalmethod checks for characters used to form numbers in base 10.
> > >s2。str。isdecimal()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.
> > >s2。str。isdigit()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.
> > >s2。str。isnumeric()0真實1真正的2真3錯誤dtype: bool