From: Andre' Walker-L. <wal...@gm...> - 2012-06-14 01:24:07
|
Hi All, Still trying to sort out a recursive walk through an hdf5 file using pytables. I have an hdf5 file with an unknown depth of groups/nodes. I am trying to write a little function to walk down the tree (with user input help) until a data file is found. I am hoping there is some function one can use to query whether you have found simply a group/node or an actual numpy array of data. So I can do something like if f.getNode('/',some_path) == "data_array": return f.getNode('/',some_path), True else: return f.getNode('/',some_path), False where I have some function that if the second returned variable is True, will recognize the file as data, where as if it is False, it will query the user for a further path down the tree. I suppose I could set this up with a try: except: but was hoping there is some built in functionality to handle this. Thanks, Andre |