如何使用压缩的PyTables CArray和R?

2024-06-30 08:42:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我用PyTables创建了一个压缩的CArray:

f = tables.openFile('/myPath/test.h5', 'w')
atom = tables.Atom.from_dtype(myNumpyArray.dtype)
ds = f.createCArray(f.root, 'myArray', atom, myNumpyArray.shape, filters=tables.Filters(5, 'blosc'))
ds[:] = myNumpyArray
f.close()

如何将数组加载到R中?我尝试了“rhdf5”包,但出现以下错误:

Error in H5Dread(h5dataset = h5dataset, h5spaceFile = h5spaceFile, h5spaceMem = h5spaceMem, : HDF5. Dataset. Read failed.

有没有可能在R中使用这种数组?如果是,是否可以只加载阵列的一部分而不加载整个阵列? 希望有人能帮我。非常感谢。你知道吗


Tags: testtablesds数组pytablesatomh5dtype