Read npy files
This commit is contained in:
@@ -11,12 +11,18 @@ except ImportError:
|
||||
class Wrap:
|
||||
def __init__(self, fname):
|
||||
n = np.load(fname, allow_pickle=True)
|
||||
files = n.files
|
||||
globs = globals()
|
||||
if isinstance(n, np.lib.npyio.NpzFile):
|
||||
files = n.files
|
||||
print('Contains files', files)
|
||||
for f in files:
|
||||
setattr(self, f, n[f])
|
||||
globs[f] = n[f]
|
||||
else:
|
||||
print('Loaded data of shape', n.shape)
|
||||
setattr(self, 'data', n)
|
||||
globs['data'] = n
|
||||
|
||||
|
||||
argv = argv[argv.index('--')+1:]
|
||||
archives = [Wrap(arg) for arg in argv]
|
||||
|
||||
Reference in New Issue
Block a user