pd.read_hdf throws 'cannot set WRITABLE flag to True of this array'

前端 未结 3 364
太阳男子
太阳男子 2020-12-15 04:37

When running

pd.read_hdf(\'myfile.h5\')

I get the following traceback error:

[[...some longer traceback]]

~/.

相关标签:
3条回答
  • 2020-12-15 05:10

    It seems that time-date strings were causing the problem and when I converted these from text to numpy (pd.to_datetime()) and stored the table and the problem went away so perhaps it has something to do with text data?

    0 讨论(0)
  • 2020-12-15 05:19

    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

    The only way I found to fix this is to downgrade numpy.

    0 讨论(0)
  • 2020-12-15 05:19

    Upgrading PyTables to version > 3.5.1 should solve this.

    pip install --upgrade tables
    
    0 讨论(0)
提交回复
热议问题