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.
For example: (("TX":3),("NJ":2))
should be the output when there are two occurrences of "TX"
and "NJ"
.
I'm fairly new to pyspark so I'm stumped with this problem. Any help would be much appreciated.