title: pyspark count rows on condition
body: <p>I have a dataframe</p>
  
  <pre><code>test = spark.createDataFrame([('bn', 12452, 221), ('mb', 14521, 330),('bn',2,220),('mb',14520,331)],['x','y','z'])
  test.show()
  </code></pre>
  
  <p>I need to count the rows based on a condition:</p>
  
  <pre><code>test.groupBy("x").agg(count(col("y")&gt;12453),count(col("z")&gt;230)).show()
  </code></pre>
  
  <p>which  gives </p>
  
  <pre><code> +---+------------------+----------------+
   |  x|count((y &gt; 12453))|count((z &gt; 230))|
   +---+------------------+----------------+
   | bn|                 2|               2|
   | mb|                 2|               2|
   +---+------------------+----------------+
  </code></pre>
  
  <p>It's just the count of the rows not the rows for certain conditions.</p>