我有一个 Nexus 文件(foo.nxs),其中包含来自测量的直接数据,我希望用熊猫打开它。但是,当我尝试典型的
HDFStore('foo.nxs') or read_hdf('foo.nxs','/group')
它只是返回一个空的 Store:
<class 'pandas.io.pytables.HDFStore'>
File path: /foo.nxs
Empty
或类型错误:
TypeError: cannot create a storer if the object is not existing nor a value are passed
文档页面中的所有示例都首先创建一个 hdf 文件,在其中存储数据然后检索它,但这是从同一个 pandas 完成的。我想知道是否可以读取以前没有用 pandas 生成的 hdf 文件。
根据@Jeff 的要求,这是 ptdump 输出的一部分:
/ (RootGroup) ''
/._v_attrs (AttributeSet), 4 attributes:
[HDF5_Version := '1.8.11',
NeXus_version := '4.3.0',
file_name := '/Messdaten/C9/20140423/messung_21h14m01.197.nxs',
file_time := '2014-04-23T21:14:01+01:00']
/exp_root.Kerr.DoublePulse2D.SuperDuperScan_V2_00001 (Group) ''
/exp_root.Kerr.DoublePulse2D.SuperDuperScan_V2_00001._v_attrs (AttributeSet), 1 attributes:
[NX_class := 'NXentry']
/exp_root.Kerr.DoublePulse2D.SuperDuperScan_V2_00001/scan_data (Group) ''
/exp_root.Kerr.DoublePulse2D.SuperDuperScan_V2_00001/scan_data._v_attrs (AttributeSet), 1 attributes:
[NX_class := 'NXdata']
/exp_root.Kerr.DoublePulse2D.SuperDuperScan_V2_00001/scan_data/actuator_1_1 (CArray(5, 121), zlib(6)) ''
atom := Float64Atom(shape=(), dflt=0.0)
maindim := 0
flavor := 'numpy'
byteorder := 'little'
chunkshape := (5, 121)