-
-
Save isaacabraham/0e9c830bf9fb2346c37b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let prices : (int * float) array = | |
[ "http://publicdata.landregistry.gov.uk/market-trend-data/price-paid-data/a/pp-2015.csv" ] | |
|> CloudFlow.OfHttpFileByLine // Stream the HTTP file across the cluster | |
|> CloudFlow.map (HousePrices.ParseRows >> Seq.head) // Convert from raw text to our CSV Provided type | |
|> CloudFlow.groupBy(fun row -> row.DateOfTransfer.Month) // Group by month | |
|> CloudFlow.map(fun (month, rows) -> month, rows |> Seq.averageBy (fun row -> float row.Price)) // Get the average price for each month | |
|> CloudFlow.toArray | |
|> cluster.Run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment