Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

PySpark columns with null or missing values

# Find Count of Null, None, NaN of All DataFrame Columns
from pyspark.sql import functions as F
df.select([F.count(F.when(F.isnan(c) | F.col(c).isNull(), c)).alias(c) 
           for c in df.columns]).show()
Source by sparkbyexamples.com #
 
PREVIOUS NEXT
Tagged: #PySpark #columns #null #missing #values
ADD COMMENT
Topic
Name
8+8 =