for
averageCount = (wordCountsDF .groupBy().mean()).head()
I get
Row(avg(count)=1.6666666666666667)
I figured it out. This will return me the value:
averageCount = (wordCountsDF .groupBy().mean()).head()[0]