h5文件的读写遇到的bug---pandas

在使用Pandas处理H5文件时,读取并操作DataFrame后将其重新保存为H5文件会出现警告。问题源于H5文件默认处理字符串的方式。为解决此警告,需要在写入时指定格式。
摘要由CSDN通过智能技术生成

用pandas读取获得的h5文件,简单操作之后,将dataframe重新存为h5文件(警告),再用pandas读取文件(报错),出现以下错误:

F:\Anaconda3\lib\site-packages\pandas\io\pytables.py:270: PerformanceWarning: 
your performance may suffer as PyTables will pickle object types that it cannot
map directly to c-types [inferred_type->integer,key->axis0] [items->None]

  f(store)
F:\Anaconda3\lib\site-packages\pandas\io\pytables.py:270: PerformanceWarning: 
your performance may suffer as PyTables will pickle object types that it cannot
map directly to c-types [inferred_type->integer,key->block0_items] [items->None]

  f(store)

读取时异常

F:\Anaconda3\lib\site-packages\pandas\io\pytables.py in read_hdf(path_or_buf, key, mode, errors, where, start, stop, columns, iterator, chunksize, **kwargs)
    421             iterator=iterator,
    422             chunksize=chunksize,
--> 423             auto_close=auto_close,
    424         )
    425     except (ValueError, TypeEr
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值