title: Can I use LINQ to retrieve only "on change" values?
body: <p>What I'd like to be able to do is construct a LINQ query that retrieved me a few values from some DataRows when one of the fields changes.  Here's a contrived example to illustrate:</p>
  
  <pre><code>Observation   Temp  Time
  ------------- ----  ------
  Cloudy        15.0  3:00PM
  Cloudy        16.5  4:00PM
  Sunny         19.0  3:30PM
  Sunny         19.5  3:15PM
  Sunny         18.5  3:30PM
  Partly Cloudy 16.5  3:20PM
  Partly Cloudy 16.0  3:25PM
  Cloudy        16.0  4:00PM
  Sunny         17.5  3:45PM
  </code></pre>
  
  <p>I'd like to retrieve only the entries when the Observation changed from the previous one.  So the results would include:</p>
  
  <pre><code>Cloudy        15.0  3:00PM
  Sunny         19.0  3:30PM
  Partly Cloudy 16.5  3:20PM
  Cloudy        16.0  4:00PM
  Sunny         17.5  3:45PM
  </code></pre>
  
  <p>Currently there is code that iterates through the DataRows and does the comparisons and construction of the results but was hoping to use LINQ to accomplish this.</p>
  
  <p>What I'd like to do is something like this:</p>
  
  <pre><code>var weatherStuff = from row in ds.Tables[0].AsEnumerable()
                     where row.Field&lt;string&gt;("Observation") != weatherStuff.ElementAt(weatherStuff.Count() - 1) )
                     select row;
  </code></pre>
  
  <p>But that doesn't work - and doesn't compile since this tries to use the variable 'weatherStuff' before it is declared.</p>
  
  <p>Can what I want to do be done with LINQ?  I didn't see another question like it here on SO, but could have missed it.  </p>