I have Array2D of 0 and 1:
let rnd = System.Random() let a = Array2D.init nn (fun ij -> int(System.Math.Round(rnd.NextDouble() / index)) )
I need to calculate the number of '1'-elements, something like:
a |> Array.filter (fun x -> x == 1)
But 'a' is Array2D (not Array), so I'm just wondering if there is a standard way to convert Array2D to Array?
source share