pyspark.sql.functions.isnull

pyspark.sql.functions.isnull(col: ColumnOrName) → pyspark.sql.column.Column

An expression that returns true iff the column is null.

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)]