npz · shipping · also .npz, NPZ

NumPy NPZ archive

NPZ is NumPy's ZIP-based container for storing multiple arrays as NPY members.

Related Observatory article: NumPy NPZ archive on hesela.com

NpzFile loads array members lazily when a caller accesses them. Successful construction or access to one member is not evidence that another member was read and checked. [2] [3]

ZIP member checks and array semantics answer different questions. A member containing a changed NPY header can receive a valid new CRC when repackaged; the CRC does not identify the intended shape, units or coordinate mapping. [1] [5]

A preservation package needs both an expected inventory and checked bytes. BagIt 1.0 formalizes this distinction, but NPZ is not thereby a BagIt bag. Checksums alone do not authenticate the source. [4]

Relations

related
NumPy NPY format, ZIP archive, Archive member, Checksum

Limitations

  • These notes do not certify hostile archives, duplicate names, pickle safety or resource limits.
  • A trusted expected member inventory and application schema are separate from a successful selected read.

Citations

  1. NumPy format documentation: NPY and NPZ layout (accessed 2026-10-24)
  2. NumPy NpzFile API (accessed 2026-10-24)
  3. NumPy 2.5.4 pinned NpzFile implementation (accessed 2026-10-24)
  4. RFC 8493: BagIt completeness, validity and active-attack limits (accessed 2026-10-24)
  5. CPython 3.12 zipfile API (accessed 2026-10-24)
Sources & caveats
  • Format/API documentation and NumPy commit a3d0ef1df045b858e68115001fdabc930bb3b68c.
  • Controlled NumPy 2.5.4 / CPython 3.12.3 observations use synthetic numeric arrays and BytesIO, not physical media, mmap or a corruption-rate sample.
  • Reproduction: https://hesela.dev/research/npy-interpretation/reproduction.zip

JSON: /data/terms/npz.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. NumPy NPZ archive. Hesela. 2026-10-24. https://hesela.dev/terms/npz/