pyspark.sql.functions.
isnull
An expression that returns true iff the column is null.
New in version 1.6.0.
Examples
>>> df = spark.createDataFrame([(1, None), (None, 2)], ("a", "b")) >>> df.select(isnull("a").alias("r1"), isnull(df.a).alias("r2")).collect() [Row(r1=False, r2=False), Row(r1=True, r2=True)]