weixin_39562234
2020-12-06 19:35 阅读 93

TypeError: No conversion path for dtype: dtype('<U34')

Here is my code:

import sys import dolfyn.adp.api as apm master = apm.read_rdi('C:\MT\DATA\MASTER\RAW\Master_RDI_001.000',nens=10000) master.save('C:\MT\DATA\MASTER\thymote_rz_master_clean_test')

I get the following error: TypeError: No conversion path for dtype: dtype('<U34')

Please advise

Thanks

该提问来源于开源项目:h5py/h5py

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • weixin_39637924 weixin_39637924 2020-12-06 19:35

    This looks relevant: http://docs.h5py.org/en/stable/strings.html#what-about-numpy-s-u-type

    You might need to raise this with the dolfyn project.

    点赞 评论 复制链接分享
  • weixin_39637924 weixin_39637924 2020-12-06 19:35

    Closing as there's nothing clear to address in h5py. It's documented that h5py doesn't accept numpy unicode arrays, because HDF5 doesn't have a datatype to represent unicode codepoints as fixed width. Unicode can be stored as UTF-8, but a fixed-length unicode string is not a predictable length when encoded to UTF-8.

    点赞 评论 复制链接分享
  • weixin_39842955 weixin_39842955 2020-12-06 19:35

    It's actually a python 3 issue. As it automatically gets addressed in normal python it is a strange error when first encountered.

    点赞 评论 复制链接分享
  • weixin_39818521 weixin_39818521 2020-12-06 19:35

    It's actually a python 3 issue. As it automatically gets addressed in normal python it is a strange error when first encountered.

    so then whats the sol for my code: f.create_dataset('scodes/' + batch_id, (len(codes),), dtype=("S{0}".format(len(codes[0])), data=codes) error: TypeError: No conversion path for dtype: dtype('<U26')

    点赞 评论 复制链接分享

相关推荐