pyspark.pandas.Index.fillna ¶
-
Index.
fillna
( value : Union[int, float, bool, str, bytes, decimal.Decimal, datetime.date, datetime.datetime, None] ) → pyspark.pandas.indexes.base.Index [source] ¶ -
用指定值填充NA/NaN值。
- Parameters
-
- value scalar
-
用于填充空洞的标量值(例如:0)。此值不能是类列表的。
- Returns
-
- Index :
-
填充了值
示例
>>> idx = ps.Index([1, 2, None]) >>> idx Float64Index([1.0, 2.0, nan], dtype='float64')
>>> idx.fillna(0) Float64Index([1.0, 2.0, 0.0], dtype='float64')