na

欠損値を処理するための DataFrameNaFunctions を返します。

返品

DataFrameNaFunctions

例示

df = spark.sql("SELECT 1 AS c1, int(NULL) AS c2")
type(df.na)
# <class '...dataframe.DataFrameNaFunctions'>

欠損値を 2 に置き換えます。

df.na.fill(2).show()
# +---+---+
# | c1| c2|
# +---+---+
# |  1|  2|
# +---+---+