Skip to content

Instantly share code, notes, and snippets.

@rayh
Created June 7, 2018 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rayh/8a855bff835608f6f6229f7cfdb1415a to your computer and use it in GitHub Desktop.
Save rayh/8a855bff835608f6f6229f7cfdb1415a to your computer and use it in GitHub Desktop.
let myTable = MLDataTable(...)
// Fetch the price column (and all it's values)
let priceColumn = myTable["price"]
// Create a new column that contains values that are the result of
// price * bedroom for each row
let priceTimesBedroomsColumn = myTable["price"] * myTable["bedrooms"]
// Remove rows that contain less that 2 bedrooms
let filteredTable = myTable["bedrooms"] < 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment