在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):clementfarabet/lua---csv开源软件地址(OpenSource Url):https://github.com/clementfarabet/lua---csv开源编程语言(OpenSource Language):Lua 92.0%开源软件介绍(OpenSource Introduction):csvigo: a package to handle CSV files (read and write).Install:First install Torch7 (www.torch.ch) then simply install this package using luarocks:
Use:The library provides 2 high-level functions: csvigo.load and csvigo.save. To get help on these functions, simply do:
Loading a CSV file in 'query' mode gives you a convenient query function that you can use to query subsets of your original CSV file. To get help on this query function, simply do:
Large CSV modeCSVigo supports efficient loading of very large CSV files into memory. The loaded data structure is a read-only table with efficiency hidden under the hood. Loading: m = csvigo.load({path = "my_large.csv", mode = "large"}) Printing by default only prints first 10 and last 10 rows print(m) Individual element access print(m[32]) Size of table: print(#m) For loop over entries: Type 1: for i=1, #m do
print(m[i]) -- get element
end Type 2: for k,v in ipairs(m) do
print(k)
print(v)
end Type 3: for k,v in pairs(m) do
print(k)
print(v)
end Read-only table -- read only table, will error here:
m[13] = 'a' |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论