Created
June 3, 2013 22:08
-
-
Save davidgrenier/5701900 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
#load @"C:\Bib\Projects\FSharpChart\F#\scripts\FSharpChart.fsx" | |
#r @"C:\Bib\Projects\FSharp.Data\src\bin\Release\FSharp.Data.dll" | |
open FSharp.Data | |
open MSDN.FSharp.Charting | |
type Types = CsvProvider<"""C:\Users\dgrenier\Desktop\race_data.csv"""> | |
let data = Types.Load """C:\Users\dgrenier\Desktop\race_data.csv""" | |
fsi.AddPrinter (fun (x: System.DateTime) -> x.ToString "yyyy/MM/dd hh:mm") | |
query { | |
for row in data.Data do | |
select (row.``Date/Time (UTC)``, float row.WPM) | |
} | |
|> Seq.windowed 6 | |
|> Seq.map (fun window -> window |> Seq.map fst |> Seq.head, window |> Seq.map snd |> Seq.average) | |
|> Seq.toArray | |
|> FSharpChart.Line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment