Deedle-readCsv的架构格式是什么 [英] Deedle - what's the schema format for readCsv

查看:92
本文介绍了Deedle-readCsv的架构格式是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在F#中使用Deedle读取txt文件(无标题)到数据帧,并且找不到有关如何指定架构的任何示例。

I was using Deedle in F# to read a txt file (no header) to data frame, and cannot find any example about how to specify the schema.

let df= Frame.ReadCsv(datafile, separators="\t", hasHeaders=false, schema=schema)

我试图给出一个名称用','分隔的字符串,但似乎不起作用。 / p>

I tried to give a string with names separated by ',', but seems don't work.

let schema = @"name, age, address";

我在文档上进行了一些搜索,但只找到以下内容-不知道在哪里可以找到该信息。 :(

I did some search on the doc, but only find following - don't know where I can find the info. :(


模式-指定CSV模式的字符串。有关模式格式的信息,请参见文档


推荐答案

模式格式与 F#数据中的CSV类型提供程序

唯一的问题(非常重要!)是Deedle库中有一个错误,它完全可以忽略 schema 参数,因此无论您提供什么,都将被忽略。

The only problem (quite important!) is that the Deedle library had a bug where it completely ignores the schema parameter, so no matter what you provide, it would be ignored.

我刚刚提交了请求修复错误的请求,还包括一些示例(以单元测试的形式)。请参见拉请求(然后单击文件已更改以查看示例)。

I just submitted a pull request that fixes the bug and also includes some examples (in the form of unit tests). See the pull request here (and click on "Files changed" to see the samples).

如果是您不想等待新版本发布,只需从我的GitHub分支中获取代码,并在根目录中使用 build.cmd 进行构建即可(第一次运行此代码,恢复软件包)。完整的构建需要本地安装R(因为它也构建R插件),但是它应该构建 Deedle.dll ,然后失败...(第一次运行 build.cmd ,则可以使用 Deedle.sln 解决方案)。

If you do not want to wait for a new release, just get the code from my GitHub fork and build it using build.cmd in the root (run this for the first time to restore packages). The complete build requires local installation of R (because it builds R plugin too), but it should build Deedle.dll and then fail... (After the first run of build.cmd, you can just use Deedle.sln solution).

这篇关于Deedle-readCsv的架构格式是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆