问题描述
运行时
pd.read_hdf('myfile.h5')
我收到以下回溯错误:
〜/.local/lib/python3.6/site-packages/pandas/io/pytables.py在 read_array(self,key,start,stop)2487 2488如果 isinstance(节点,表.VLArray): -> 2489 ret =节点[0] [开始:停止] 2490否则:2491 dtype = getattr(attrs,'value_type',None)
~/.local/lib/python3.6/site-packages/pandas/io/pytables.py in read_array(self, key, start, stop) 2487 2488 if isinstance(node, tables.VLArray): -> 2489 ret = node[0][start:stop] 2490 else: 2491 dtype = getattr(attrs, 'value_type', None)
〜/.local/lib/python3.6/site-packages/tables/vlarray.py在 getitem ((自身,密钥)
~/.local/lib/python3.6/site-packages/tables/vlarray.py in getitem(self, key)
〜/.local/lib/python3.6/site-packages/tables/vlarray.py in read(self, 开始,停止,执行步骤
~/.local/lib/python3.6/site-packages/tables/vlarray.py in read(self, start, stop, step)
tables/hdf5extension.pyx
tables/hdf5extension.pyx in tables.hdf5extension.VLArray._read_array()
ValueError:无法将此数组的WRITEABLE标志设置为True
ValueError: cannot set WRITEABLE flag to True of this array
不知道发生了什么.我试过基本上重新安装tables
,pandas
的所有内容,但不想阅读.
No clue what's going on. I've tried reinstalling tables
, pandas
everything basically, but doesn't want to read it.
推荐答案
您是否正在使用numpy 1.16?它与最新版本的pytables不兼容(请参见 https: //github.com/PyTables/PyTables/blob/v3.4.4/tables/hdf5extension.pyx#L2155 ),但pytables小组尚未发布固定版本: https://github.com/PyTables/PyTables/issues/719
Are you using numpy 1.16? It is incompatible with the latest release of pytables (see https://github.com/PyTables/PyTables/blob/v3.4.4/tables/hdf5extension.pyx#L2155) but the pytables team have not yet released a fixed version: https://github.com/PyTables/PyTables/issues/719
我发现解决此问题的唯一方法是降级numpy.
The only way I found to fix this is to downgrade numpy.
这篇关于pd.read_hdf抛出“无法将此数组的WRITABLE标志设置为True"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!