you need to change your select so that it creates your jagged array elements.
var vavg = (from z in data
where z.Y > 0 && z.Y < 0.1
group z by z.X into XGroup
select new double []
{
XGroup.Key,
XGroup.Average(z => z.A),
}).ToArray();
See the declaration of the
new double[]
on the
select
. Also got rid of the temporary assignments in there - they're not needed.