title: how to get most frequent values of a dataframe in PySpark
body: <p>I am well familiar with Pandas data frame where I use function "mode" and "groupby" to get most frequent values,like below </p>
  
  <pre><code>df3=df5.groupby(['band']).apply(lambda x: x.mode())
  </code></pre>
  
  <p>however I am facing some difficulties to get in PySpark.</p>
  
  <p>I have a spark data frame as follows:</p>
  
  <pre><code>band      A3    A5  status
  4G_band1800 12  18  TRUE
  4G_band1800 12  18  FALSE
  4G_band1800 10  18  TRUE
  4G_band1800 12  12  TRUE
  4g_band2300 6   24  FALSE
  4g_band2300 6   22  FALSE
  4g_band2300 6   24  FALSE
  4g_band2300 3   24  TRUE
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9XHhJ.png" rel="nofollow noreferrer">Screenshot of above</a></p>
  
  <p>What I want is as follows:</p>
  
  <pre><code>band      A3    A5  status
  4G_band1800 12  18  TRUE
  4g_band2300 6   24  FALSE
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1pHQS.png" rel="nofollow noreferrer">Screenshot of above</a></p>
  
  <p>I have tried all possible combinations but haven't got any reasonable output.
  Please suggest a way.</p>