pyspark.sql.functions.isnotnull#

pyspark.sql.functions.isnotnull(col)[source]#

Returns true if col is not null, or false otherwise.

New in version 3.5.0.

Parameters
colColumn or str

Examples

>>> df = spark.createDataFrame([(None,), (1,)], ["e"])
>>> df.select(isnotnull(df.e).alias('r')).collect()
[Row(r=False), Row(r=True)]