Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

PySpark find columns with null 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 #find #columns #null #values
ADD COMMENT
Topic
Name
1+2 =