title: groupby category and sum the count
body: <p>Let's say I have a table (df) like so:</p>
  <pre><code>    type count
      A    5000
      B    5000
      C    200
      D    123
      ...  ...
      ...  ...
      Z    453
  </code></pre>
  <p>How can I sum the column <code>count</code> by type <code>A</code>, <code>B</code> and all other types fall into <code>Others</code> category?</p>
  <p>I currently have this:</p>
  <pre><code>df = df.withColumn('type', when(col(&quot;type&quot;).isnot(&quot;A&quot;, &quot;B&quot;))
  </code></pre>
  <p>My expected output would be like so:</p>
  <pre><code>type  count
  A     5000
  B     5000
  Other 3043
  </code></pre>