在R和Python之间交叉读取镶木地板文件 [英] Cross read parquet files between R and Python

查看:88
本文介绍了在R和Python之间交叉读取镶木地板文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们生成了一个实木复合地板文件,一个在 Dask (Python)中,另一个在 R Drill 中使用( 中士数据包)。他们使用 parquet 看到我的其他拼花地板问题

We have generated a parquet files, one in Dask (Python) and another with R Drill (using the Sergeant packet ). They use a different implementations of parquet see my other parquet question

我们无法交叉读取文件(Python无法读取R文件,反之亦然)。

在R环境中读取Python实木复合地板文件时,我们收到以下错误:系统错误:Illegalstatexception:UTF8只能注释二进制文件

在Dask中读取R / Drill实木复合地板文件时,我们得到 FileNotFoundError:[错误2]没有这样的文件或目录... \_metadata (这是不言而喻的)。

在R和Python之间交叉读取镶木地板文件有哪些选项?

We are not able to cross read the files (the python can't read the R file and vice versa).
When reading the Python parquet file in the R environment we receive the following error: system error: Illegalstatexception: UTF8 can only annotate binary filed .
When reading the R/Drill parquet file in Dask we get an FileNotFoundError: [Error 2] no such file or directory ...\_metadata (which is self explanatory).
What are the options to cross read parquet files between R and Python?

任何见解都会受到赞赏。

Any insights would be appreciated.

推荐答案

要阅读钻探,就像带有fastparquet / dask的镶木地板数据集一样,您需要粘贴文件名列表,例如

To read drill-like parquet data-sets with fastparquet/dask, you need to pas a list of the filenames, e.g.,

files = glob.glob('mydata/*/*.parquet')
df = dd.read_parquet(files)

从另一个方向走过来的错误可能是一个错误,或者(从另一个问题中收集来的)可能表明您使用了固定长度的字符串,但drill / R不支持它们。

The error from going in the other direction might be a bug, or (gathering from your other question), may indicate that you used fixed-length strings, but drill/R doesn't support them.

这篇关于在R和Python之间交叉读取镶木地板文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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