I have a series data in IEnumrable<double>.
Let the dummy data be:
0
0
0
1
1.6
2.5
3.5
2.51
1.0
0
0
0
2.52
3.5
6.5
4.5
1.2
1.0
2.53
3.5
let my value of Exceedence be 1.5, so I want to count the number of time my value in series goes above 1.5 (basically number of times 1.5 constant line cut the graph). In above case it will be 3 ({1.6-2.51}, {2.52-4.5}, {2.53-3.5}).
I can do this by iterating through each member and keeping the count everytime it goes up or down the Exceedence value.
I am wondering is there any way to do this using LINQ query.
Is that what you want?