Skip to content

Instantly share code, notes, and snippets.

@sudipto80
Created June 10, 2015 05:02
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/e5ac68b0b04a4d78a3a5 to your computer and use it in GitHub Desktop.
Save sudipto80/e5ac68b0b04a4d78a3a5 to your computer and use it in GitHub Desktop.
#r @"C:\Users\mukhsudi\Documents\GitHub\SquirrelLatest\ConsoleApplication2\bin\Debug\TableAPI.dll"
//type NameAndSex = {Name : string ; Sex : string}
type SurvivalStat = {PClass : string; Died : float; Survived :float}
let titanic = Squirrel.DataAcquisition.LoadCSV(@"C:\titanic.csv")
let classes = titanic.SplitOn("Pclass")
let result = new Squirrel.Table()
let pClasses = [|"1";"2";"3"|]
let persons = pClasses |> Array.map ( fun pClass ->
{
PClass = pClass;
Died=classes.[pClass].GetPercentage("Survived", "0");
Survived=classes.[pClass].GetPercentage("Survived", "1")
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment