I have a input stream where the input element consist of Date, Depth and Area. I want to plot the Area against the Depth and want therefor to take out a window of Depth e.g. between 1.0-100.0m. The problem is that I want to down sample the input stream since there can be many inputs with close Depth values. I want to partition the input into x bins, e.g. 2 bins means all depth values between 1-50 is averaged in the first bin and 51-100 in the second bin.
I was thinking something like this:
var q = from e in input
where (e.Depth > 1) && (e.Depth <= 100)
// here I need some way of partition the sequence into bins
// and averaging the elements.
Split a collection into `n` parts with LINQ? wants to do something similar without rx.