title: Pyspark - Calculate number of null values in each dataframe column
body: <p>I have a dataframe with many columns. My aim is to produce a dataframe thats lists each column name, along with the number of null values in that column.</p>
  
  <p>Example:</p>
  
  <pre><code>+-------------+-------------+
  | Column_Name | NULL_Values |
  +-------------+-------------+
  |  Column_1   |      15     |
  |  Column_2   |      56     |
  |  Column_3   |      18     |
  |     ...     |     ...     |
  +-------------+-------------+
  </code></pre>
  
  <p>I have managed to get the number of null values for ONE column like so:</p>
  
  <pre><code>df.agg(F.count(F.when(F.isnull(c), c)).alias('NULL_Count'))
  </code></pre>
  
  <p>where <code>c</code> is a column in the dataframe. However, it does not show the name of the column. The output is:</p>
  
  <pre><code>+------------+
  | NULL_Count |
  +------------+
  |     15     |
  +------------+
  </code></pre>
  
  <p>Any ideas?</p>