clementfarabet / lua---csv

A package to read and write CSV. Provides high-level database-like handlers.
46 stars 16 forks source link

Query missing values #10

Closed mlajtos closed 9 years ago

mlajtos commented 9 years ago

Querying missing values in the CSV file breaks everything.

Example:

--[[
Contents of test.csv:

"start","end"
"a","b"
"b","c"
--]]

test = csvigo.load{path='test.csv', mode='query'}
test("union", {start="d"})
soumith commented 9 years ago

Thanks! fixed in trunk now.

soumith commented 9 years ago
 ______             __   |  Torch7
 /_  __/__  ________/ /   |  Scientific computing for Lua.
  / / / _ \/ __/ __/ _ \  |  Type ? for help
 /_/  \___/_/  \__/_//_/  |  https://github.com/torch
                          |  http://torch.ch

th> test = csvigo.load{path='test.csv', mode='query'}
<csv>   parsing file: test.csv
<csv>   tidying up entries
<csv>   generating reversed index for fast queries
<csv>   returning query closure, type query('help') to get help
                                                                      [0.0002s]
th> test("union", {start="d"})
{
  start : {...}
  end : {...}
}
mlajtos commented 9 years ago

Thank you! :)