将 .h5/.hic 文件转换为 .csv/.json

发布于 2025-01-16 22:18:12 字数 333 浏览 1 评论 0原文

我想将 .h5/.hic 文件转换为 .csv/.json 格式。我找到了这个 https://pypi.org/project/h5json/ 及其 GitHub 页面 https://github.com/HDFGroup/hdf5-json 从 h5 转换为 json。我安装成功了,但之后就无法继续了。我也研究了其他选择,但似乎没有任何效果。

I want to convert .h5/.hic files to .csv/.json format. I found this https://pypi.org/project/h5json/ and their GitHub page https://github.com/HDFGroup/hdf5-json to convert to json from h5. I was successful in installing it but I could not move forward after that. I looked into other options too but nothing seems to work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怀中猫帐中妖 2025-01-23 22:18:12

一个可能的解决方案是pandas,请参阅官方指南

这是一个例子:

import pandas as pd

df = pd.DataFrame({"x": list(range(5)), "y": list(range(5))})
df.to_hdf("tab.h5", "table")
pd.read_hdf("tab.h5", "table").to_json("tab.json")

在我的环境中,我使用了 https://pypi.org/project/tables/ 正确安装PyTables

A possible solution is pandas, see the official guide.

Here an example:

import pandas as pd

df = pd.DataFrame({"x": list(range(5)), "y": list(range(5))})
df.to_hdf("tab.h5", "table")
pd.read_hdf("tab.h5", "table").to_json("tab.json")

In my environment, I used https://pypi.org/project/tables/ to correctly install PyTables

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文