pd.read_hdf throws 'cannot set WRITABLE flag to True of this array'
回答问题
跑步时
pd.read_hdf('myfile.h5')
我收到以下回溯错误:
[[...更长的回溯]]
~/.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 u003d node[0][start:stop] 2490 其他:2491 dtype u003d getattr(attrs,'value_type',无)
~/.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, start, stop, step)
tables/hdf5extension.pyx 在 tables.hdf5extension.VLArray._read_array()
ValueError:无法将此数组的 WRITEABLE 标志设置为 True
不知道发生了什么事。我已经尝试重新安装tables,pandas基本上所有内容,但不想阅读它。
Answers
您使用的是 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
我发现解决此问题的唯一方法是降级 numpy.
更多推荐

所有评论(0)