h5py写一个hdf文件,有关尺寸的问题 [英] h5py writing a hdf file , question about dimension

查看:127
本文介绍了h5py写一个hdf文件,有关尺寸的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个句柄为fw的新文件.

I created a new file whose handle is fw.

fw.create_dataset('grp1/grp2/grp2/varname',data=arr)

在此命令之前创建组. arr是具有以下内容的numpy array 尺寸(2,3). 文件创建成功.但是,尺寸被命名为phony_0, 和phony_1.如何将它们更改为mn?

The groups are created before this command. arr is a numpy array with dimensions (2,3). The file is created successfully. However, the dimensions are named phony_0, and phony_1. How do I change them to say m and n ?

通常,一个人如何在一个组内创建维度,然后进行关联 变量吗?

In general how does one create dimensions within a group and then associate variables with them?

谢谢

推荐答案

您可能会做类似的事情

dataset.dims[0].label = 'm'
dataset.dims[1].label = 'n'

但实际上,所有内容都在官方文档中: http://docs .h5py.org/en/latest/high/dims.html

But really, it's all in the official docs: http://docs.h5py.org/en/latest/high/dims.html

这篇关于h5py写一个hdf文件,有关尺寸的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆