Is it possible to get the mean, median and stdev result from the list of list. Here is my initial code that needs to compute:
var myList = new List<List<double>>();
myList.Add(new List<double> { 1, 3, 6, 8});
myList.Add(new List<double> { 1, 2, 3, 4});
myList.Add(new List<double> { 1, 4, 8, 12});
And expected result is to get the mean, median, and stdev of first and last index only:
Mean: 1, 8
Median: 1, 8
Stdev: 0, 3.265986324
I tried to loop the list to get the average but not sure if this is the best way:
foreach(var i in myList )
{
Console.WriteLine(i[0].Average());
}
Any suggestion/comments TIA