@john zyd, Welcome to Microsoft Q&A, based on my test, you could use the following code to use linq to find average value of a double list.
var result1 = from d1 in price_data.Item1
from d2 in price_data.Item2
select new
{
id1 = d1.Aggregate((x, y) => (x * y)) / d1.Count(),
id2 = d2.Aggregate((x, y) => (x * y)) / d1.Count(),
id3 = d1.Sum() / (d1.Count()*2),
id4 = d2.Sum() / (d2.Count()*2)
};
var result2 = new Tuple<double, double>(result1.Sum(i => i.id1) / result1.Sum(i => i.id3), result1.Sum(i => i.id2) / result1.Sum(i => i.id4));
Result:
Hope my code could help you.
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.