Skip to content

Instantly share code, notes, and snippets.

@anupamchugh
Last active November 22, 2019 17:14
Show Gist options
  • Save anupamchugh/48fec9b9fdbe0f1e02ea9b63d1c659b8 to your computer and use it in GitHub Desktop.
Save anupamchugh/48fec9b9fdbe0f1e02ea9b63d1c659b8 to your computer and use it in GitHub Desktop.
let parsingOptions = MLDataTable.ParsingOptions(containsHeader: Bool = true, delimiter: String = ",",
comment: String = "", escape: String = "\\",
doubleQuote: Bool = true, quote: String = "\"",
skipInitialSpaces: Bool = true, missingValues: [String] = ["NA"],
lineTerminator: String = "\n", selectColumns: [String]? = nil,
maxRows: Int? = nil, skipRows: Int = 0)
var data = try MLDataTable(contentsOf: URL(fileURLWithPath: "/your/path/here"), options: parsingOptions)
print(data.size) //5043 rows and 28 columns in our IMDB dataset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment