Note
Kailangan ng pahintulot para ma-access ang page na ito. Maaari mong subukang mag-sign in o magpalit ng mga direktoryo.
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang baguhin ang mga direktoryo.
An expression that returns true if the column is NaN. Supports Spark Connect.
For the corresponding Databricks SQL function, see isnan function.
Syntax
from pyspark.sql import functions as dbf
dbf.isnan(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 NaN and False otherwise.
Examples
from pyspark.sql import functions as dbf
df = spark.createDataFrame([(1.0, float('nan')), (float('nan'), 2.0)], ("a", "b"))
df.select("*", dbf.isnan("a"), dbf.isnan(df.b)).show()
+---+---+--------+--------+
| a| b|isnan(a)|isnan(b)|
+---+---+--------+--------+
|1.0|NaN| false| true|
|NaN|2.0| true| false|
+---+---+--------+--------+