title: Drop if all entries in a spark dataframe's specific column is null
body: <p>Using Pyspark, how can I select/keep all <strong>columns</strong> of a DataFrame which contain a non-null value; or equivalently remove all columns which contain no data.</p>
  
  <p>Edited: As per Suresh Request, </p>
  
  <pre><code>for column in media.columns:
      if media.select(media[column]).distinct().count() == 1:
          media = media.drop(media[column])
  </code></pre>
  
  <p>Here I assumed that if count is one, then it should be Nan. But I wanted to check whether that is Nan. And if there's any other inbuilt spark function, let me know.</p>