spdl.io.NpzFile

class NpzFile[source]

A class mimics the behavior of numpy.lib.npyio.NpzFile.

It is a thin wrapper around a zip archive, and implements collections.abc.Mapping interface.

See load_npz() for the usage.

Methods

close()

get(k[,d])

items()

keys()

values()

__getitem__(key)[source]

Provide dictionary-like access to array data.

One difference from the regular dictionary access is that it also supports accessing the item without .npy suffix in the key. This matches the behavior of numpy.lib.npyio.NpzFile.

__iter__()[source]
__len__()[source]
close()[source]