0

i want to convert an Array of Lists

public static List<string>[] Data { get; private set; }

to a 2 dimensional Array of double.

My attempt looks like this:

var data = Data.Select(c => c.Select(double.Parse).ToArray()).ToArray();

But with this method i got as a result a double[][], an array of arrays. How can i convert to a 2-dimensional array double[,]?

Each List<string> is a column.

For example Data is an array of 10 List<string>. Each List has 160.000 entries. I want to convert this to a 10x160.000 matrix.

Thanks in ahead.

0 Answers0