using System.Collections.Generic;
public static void Main()
var ys = new List<double[]>{new double[]{1, 2, 3, 4, 5}, new double[]{10, 20, 30, 40, 50}, new double[]{100, 200, 300, 400, 500}};
var res = ys.Pivot().Select(StDev);
public static double StDev(double[] input)
double avg = input.Average();
double sum = input.Select(x => (avg - x) * (avg - x)).Sum();
return Math.Sqrt(sum / input.Length);
public static class Extensions
public static IEnumerable<T[]> Pivot<T>(this List<T[]> items)
return items.SelectMany( arr => arr.Select( (x,i) => new{Value=x,Index = i}) )
.Select(g => g.Select(x => x.Value).ToArray());