Python Forum
h5py: deep dataset access
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
h5py: deep dataset access
#1
All

I'm looking in a way to list and record hdf5 file content (full path and dataset number/names) into lists; digging into internet, I've found the following ways to print them, but how to record them?

I tried to append the list by giving it as a second argument, but it fails; could you help?

Thanks

Paul
def print_attrs(name, obj):
    print(name)
    print(obj)
    for key, val in obj.attrs.items():
        print("{}: {}" .format(key, val))
        
with h5py.File('myfile.h5', 'r') as f:    
    group_names = list(h5.keys())
    f.visititems(print_attrs)
    f.visit(print)
Reply


Messages In This Thread
h5py: deep dataset access - by paul18fr - Nov-26-2019, 02:30 PM
RE: h5py: deep dataset access - by paul18fr - Nov-26-2019, 03:34 PM
RE: h5py: deep dataset access - by paul18fr - Nov-28-2019, 03:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Deep Learning Book ankitdixit 2 2,663 Feb-06-2020, 12:01 PM
Last Post: buran
  Free ebook "Deep Learning with PyTorch" ThomasL 0 2,311 Nov-22-2019, 02:50 PM
Last Post: ThomasL
  Extract of matrix subpart using a deep copy paul18fr 2 2,331 May-02-2019, 06:49 AM
Last Post: paul18fr
  3D Object Recognition using Deep Learning chandininair 0 2,235 Aug-08-2018, 11:29 PM
Last Post: chandininair

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020