gpt4 book ai didi

julia - 列出 julia 中 hdf5 文件的字段

转载 作者:行者123 更新时间:2023-12-03 16:14:54 28 4
gpt4 key购买 nike

julia 中有没有办法在不加载数据集的情况下列出 hdf5 文件的字段(包括结构、组、维度)?我在 HDF5 包中没有找到类似于 h5ls -r -f 的东西。谢谢。

最佳答案

不是 100% 您的要求,而是使用 print 缺少哪些信息或 names ?

例如

# make hdf5 file & add two datasets
A = Vector{Int}(1:10)
h5write("bar.h5", "foo", A)
h5write("bar.h5", "2foo", 2A)

i = h5open("bar.h5", "r") # Open it
names(i)
# 2-element Array{String,1}:
# "2foo"
# "foo"
[println(a) for a in i]
# HDF5 dataset: /2foo (file: bar.h5)
# HDF5 dataset: /foo (file: bar.h5)

## Run h5ls
;h5ls "bar.h5"
# 2foo Dataset {10}
# foo Dataset {10}

关于julia - 列出 julia 中 hdf5 文件的字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47137905/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com