Skip to content

Instantly share code, notes, and snippets.

@sudipto80
Created August 4, 2016 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sudipto80/5ea6c14bea13b92e760dfc6d0d97b80b to your computer and use it in GitHub Desktop.
Save sudipto80/5ea6c14bea13b92e760dfc6d0d97b80b to your computer and use it in GitHub Desktop.
rainfall.fs
let rainfall = [[1.17;0.78];[1.24;3.22];[1.277;1.4]]
let months = [|"January";"February"|]
let rainfalStats = [ 0 .. months.Length - 1]
|> List.map
(
fun index ->
(
months.[index],
rainfall |> List.map (fun row -> List.nth row index)
|> List.average
)
)
printfn "%A" rainfalStats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment