title: How to calculate the counts of each distinct value in a pyspark dataframe?
body: <p>I have a column filled with a bunch of states' initials as strings. My goal is to how the count of each state in such list.</p>
  
  <p>For example: <code>(("TX":3),("NJ":2))</code> should be the output when there are two occurrences of <code>"TX"</code> and <code>"NJ"</code>.</p>
  
  <p>I'm fairly new to pyspark so I'm stumped with this problem. Any help would be much appreciated.</p>