pyspark.pandas.Series.mask

系列。 面具 ( 气孔导度:pyspark.pandas.series.Series,其他:任何= )→pyspark.pandas.series.Series

更换条件为真值。

参数
气孔导度 布尔系列

电导率是假的,保持原始值。真的,从其他替换为相应的价值。

其他 标量,系列

条目,电导率是真的从其他替换为相应的价值。

返回
系列

例子

> > >pyspark.pandas.config进口set_option,reset_option> > >set_option(“compute.ops_on_diff_frames”,真正的)> > >s1=ps系列([0,1,2,3,4])> > >s2=ps系列([One hundred.,200年,300年,400年,500年])> > >s1面具(s1>0)sort_index()0 0.01南2南3南4南dtype: float64
> > >s1面具(s1>1,10)sort_index()0 012 103 104 10dtype: int64
> > >s1面具(s1>1,s1+One hundred.)sort_index()0 012 102年3 103104年4dtype: int64
> > >s1面具(s1>1,s2)sort_index()0 012 300年3 400500年4dtype: int64
> > >reset_option(“compute.ops_on_diff_frames”)