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.

Parameters:
  • data – The archive data to load.

  • meta – Metadata describing each archive entry.

  • max_uncompressed_bytes – Maximum cumulative declared uncompressed size of DEFLATE-compressed entries. Defaults to 1 GiB.

Added in version 0.7.0: The max_uncompressed_bytes argument.

Methods

get(k[,d])

items()

keys()

values()

__getitem__(key: str) → NDArray[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__() → Iterator[str][source]
__len__() → int[source]