title: How to output the count of all pairwise combination of two binary columns from a Spark dataframe even when it is zero count?
body: <p>How to output the count of all pairwise combination of two binary(0/1) columns from a Spark dataframe even when the count is zero?</p>
  <pre><code>final_sdf.groupBy('actual', 'prediction').count().show()
  </code></pre>
  <p>Current output is</p>
  <p><a href="https://i.stack.imgur.com/QesX4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QesX4.png" alt="Current" /></a></p>
  <p>But my desired output includes the zero groups as below.</p>
  <p><a href="https://i.stack.imgur.com/zRUwd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zRUwd.png" alt="Desired" /></a></p>