title: How to check if spark dataframe is empty in pyspark
body: <p>Right now, I have to use df.count > 0 to check if the data frame is empty or not. But it is kind of inefficient. Is there any better way to do that.</p>
  
  <p>Thanks.</p>
  
  <p>PS: I want to check if it's empty so that I only save the data frame if it's not empty</p>
  
  <p><a href="https://stackoverflow.com/questions/32707620/how-to-check-if-spark-dataframe-is-empty">How to check if spark dataframe is empty</a> - this question tell me a way in scala, I am looking for a way in pyspark.</p>