Jun-10-2021, 12:03 PM
Hi
I'm working on hdf5 files having group and subgroups, so I'm providing the path to the datasets or the groups. In practise, I know how to check if a group and/or a dataset exists using ".keys()", but is it possible to check if the path (or an object) exists or not?
I've been digging in the doc, but still looking for the answer
Thanks
The following generates an error since the path is not valid
I'm working on hdf5 files having group and subgroups, so I'm providing the path to the datasets or the groups. In practise, I know how to check if a group and/or a dataset exists using ".keys()", but is it possible to check if the path (or an object) exists or not?
I've been digging in the doc, but still looking for the answer
Thanks
The following generates an error since the path is not valid
if hdf5['MyPath']: print("ok Path exists")
Error:KeyError: "Unable to open object (object 'MyPath' doesn't exist)"