【发布时间】:2021-05-31 17:00:04
【问题描述】:
在 node.js 环境中使用 Danfo.js,读取 .csv 文件非常简单,如the official example:所示
const dfd = require("danfojs-node")
dfd.read_csv("file:///home/Desktop/user_names.csv")
.then(df => {
df.head().print()
}).catch(err=>{
console.log(err);
})
但是,我找不到读取 .tsv 文件的方法。
有没有办法用 Danfo.js 读取制表符分隔的文件?
在source 我找到以下评论:
* @param {config} (Optional). A CSV Config object that contains configurations
* for reading and decoding from CSV file(s).
但我是来自 R/Python 的 javascript 新手,不知道从那里做什么。
【问题讨论】:
-
danfo.js 显然是 tfjs 后端的包装器。在 tensorflow/js 文档中,我找到了原始函数的参考:js.tensorflow.org/api/latest/#data.csv 如何通过 Danfo.js 传递这些参数?
标签: javascript node.js tensorflow.js danfojs