📜  pyspark 检查所有列的空值 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:19.038000             🧑  作者: Mango

代码示例1
from pyspark.sql.functions import isnan, when, count, col

df.select([count(when(isnan(c), c)).alias(c) for c in df.columns]).show()
+-------+----------+---+
|session|timestamp1|id2|
+-------+----------+---+
|      0|         0|  3|
+-------+----------+---+