title: Select one group at one time in a dataframe
body: <p>I have a dataframe.</p>
  
  <p>I grouped the dataframe using following code.</p>
  
  <pre><code>  val w = Window.partitionBy($"column name").orderBy($"column name".asc)
  
    val group = table.withColumn("rank", row_number().over(w))
  </code></pre>
  
  <p>I want to know is there any way to take one group at a one time. Because I need to put another logic to each group. </p>
  
  <p>Thank you :)</p>