title: difference in list of rows in the succeeding window from the preceeding window in scala
body: <p>I have a <em>dataframe 1</em>. For each timeframe <em>'t'</em>, I want to compare the list of rows for two adjacent window of rows -- for example difference between ((a,b,c), (b,c,d)...) and ((a, b, c), (x, y, z)...) for t=1 and t=2 respectively. Basically, I want to get difference in list in the succeeding window from the preceeding window i.e. the <em>diff</em> operation between the two lists of lists in two time frames. The expected dataframe looks like a dataframe 2.</p>
  
  <p><strong>Dataframe 1</strong>  </p>
  
  <pre><code>+---+---+---+---+
  | t | A | B | C |
  +---+---+---+---+
  | 1 | a | b | c |   
  | 1 | b | c | d |   
  | 1 | c | d | e |   
  | 1 | c | d | f |   
  | 1 | d | e | f |   
  | 2 | a | b | c |   
  | 2 | x | y | z |   
  | 2 | c | d | e |   
  | 2 | w | x | y |   
  | 3 | w | x | y |   
  | 3 | c | d | e |   
  | 3 | m | n | o |   
  +---+---+---+---+
  </code></pre>
  
  <p><strong>Dataframe 2 (resultant dataframe)</strong></p>
  
  <pre><code>+---+------+
  | t | Diff |
  +---+------+
  | 1 |  0   |
  | 2 |  2   |   
  | 3 |  1   |   
  +---+------+
  </code></pre>
  
  <p>Any help would be greatly appreciated.
  Thank you.</p>