當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python pyspark Series.combine_first用法及代碼示例

本文簡要介紹 pyspark.pandas.Series.combine_first 的用法。

用法:

Series.combine_first(other: pyspark.pandas.series.Series) → pyspark.pandas.series.Series

組合 Series 值,首先選擇調用 Series 的值。

參數

otherSeries

要與 Series 組合的值。

返回

Series

將 Series 與其他對象組合的結果。

注意

結果索引將是兩個索引的並集。

例子

>>> s1 = ps.Series([1, np.nan])
>>> s2 = ps.Series([3, 4])
>>> with ps.option_context("compute.ops_on_diff_frames", True):
...     s1.combine_first(s2)
0    1.0
1    4.0
dtype: float64

相關用法


注:本文由純淨天空篩選整理自spark.apache.org大神的英文原創作品 pyspark.pandas.Series.combine_first。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。