Update pandas DataFrame in stored in a Pytable with another pandas DataFrame

▼魔方 西西 提交于 2019-12-05 13:10:45

In the end, I found it out myself. In my case, when it is okay to overwrite the entire Node as the "combine_first" gets you the original and the new values', it is fine to use

store.put(key,value,table=True,append=False) 

instead of the

store.append(key,value).

This is not supported currently. PyTables does support an update method, but is not implemented in pandas.

Easiest method is to either use mode='w' and write a new file or

store.remove(key); store.append(.....)

HDF5 is not a 'regular' database and updating is not a common operation, if you need that SQL might be an option.

Feel free to request update as an enhancement as an issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!