הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
An expression that returns true if the column is null. Supports Spark Connect.
For the corresponding Databricks SQL function, see isnull function.
Syntax
from pyspark.sql import functions as dbf
dbf.isnull(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
Target column to compute on. |
Returns
pyspark.sql.Column: True if value is null and False otherwise.
Examples
from pyspark.sql import functions as dbf
df = spark.createDataFrame([(1, None), (None, 2)], ("a", "b"))
df.select("*", dbf.isnull("a"), dbf.isnull(df.b)).show()
+----+----+-----------+-----------+
| a| b|(a IS NULL)|(b IS NULL)|
+----+----+-----------+-----------+
| 1|NULL| false| true|
|NULL| 2| true| false|
+----+----+-----------+-----------+