Skip to content

Instantly share code, notes, and snippets.

@lakshay-arora
Created November 3, 2019 13:48
Show Gist options
  • Save lakshay-arora/b56ba7eadaabc5d304a23702f488b23a to your computer and use it in GitHub Desktop.
Save lakshay-arora/b56ba7eadaabc5d304a23702f488b23a to your computer and use it in GitHub Desktop.
# import sql function pyspark
import pyspark.sql.functions as f
# null values in each column
data_agg = my_data.agg(*[f.count(f.when(f.isnull(c), c)).alias(c) for c in my_data.columns])
data_agg.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment