title: How can I obtain percentage frequencies in pyspark
body: <p>I am trying to get percentage frequencies in pyspark. I did this in python as follows </p>
  
  <pre><code>Companies = df['Company'].value_counts(normalize = True)
  </code></pre>
  
  <p>Getting the frequencies is fairly straightforward:</p>
  
  <pre><code># Dates in descending order of complaint frequency 
  df.createOrReplaceTempView('Comp')
  CompDF = spark.sql("SELECT Company, count(*) as cnt \
                      FROM Comp \
                      GROUP BY Company \
                      ORDER BY cnt DESC")
  CompDF.show()
  </code></pre>
  
  
  
  <pre><code>+--------------------+----+  
  |             Company| cnt|  
  +--------------------+----+  
  |BANK OF AMERICA, ...|1387|  
  |       EQUIFAX, INC.|1285|  
  |WELLS FARGO &amp; COM...|1119|  
  |Experian Informat...|1115|  
  |TRANSUNION INTERM...|1001|  
  |JPMORGAN CHASE &amp; CO.| 905|  
  |      CITIBANK, N.A.| 772|  
  |OCWEN LOAN SERVIC...| 481|  
  </code></pre>
  
  <p>How do I get to percent frequencies from here? I tried a bunch of things with not much luck. 
  Any help would be appreciated.</p>