pyspark.sql.Column.isNull

Column.isNull() → pyspark.sql.column.Column

True if the current expression is null.

Changed in version 3.4.0: Supports Spark Connect.

Examples

>>> from pyspark.sql import Row
>>> df = spark.createDataFrame([Row(name='Tom', height=80), Row(name='Alice', height=None)])
>>> df.filter(df.height.isNull()).collect()
[Row(name='Alice', height=None)]