Skip to content
Novus Examples
npy12.7 KB

NumPy .npy Format Version 2.0 — Header Beyond 64 KiB (.npy)

A 300-field structured array whose descriptor is too long for a version 1.0 header, forcing format version 2.0 and its four-byte header-length field. A hand-rolled parser that assumes the two-byte 1.0 field mis-locates the data section entirely.

Preview — schema + first 6 rowsnpy
FieldValue
Format version2.0
Header length field4 bytes little-endian (version 1.0 uses 2)
Total header bytes8192
Why version 2.0300 named float32 fields overflow the 65535-byte 1.0 header limit
Fieldschannel_000_mV .. channel_299_mV
Records4
A parser hardcoded to a 2-byte header length reads garbage from byte 10 onward.

Specifications

Npy Version
2.0
Fields
300
Records
4
Header Length Field
4 bytes (1.0 uses 2)
Total Header Bytes
8192
Reason
a 300-field descriptor exceeds the 65535-byte version 1.0 limit

Testing contract

Expected to pass
Scenario
Read the version bytes at offset 6 and 7, then use the correct header-length width to locate the start of the data.
Expected result
The version reads as 2.0, the header length occupies four bytes and totals 8192 bytes including the magic, and the 300 fields parse in declaration order.

What is a .npy file?

NPY is NumPy's native binary format for a single array. A short header records the dtype, shape, and memory order, followed by the raw array bytes, so an array round-trips exactly without any text parsing. It is the standard way to persist embeddings, tensors, and numeric matrices in the Python data stack.

How to use this file

Use an example .npy to test array loaders (numpy.load), tensor and embedding pipelines, and converters between .npy, JSON, and columnar formats like Parquet.

How to use this file for testing

“NumPy .npy Format Version 2.0 — Header Beyond 64 KiB (.npy)” is a deterministic Novus Examples fixture for Scientific data, Serialization testing, Error handling. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS) — for testing reference managers, molecule viewers, and scientific-data loaders.

Documented properties for this file: 4 records · 300 fields. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Scientific fixtures are small, valid, and fully synthetic — no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.

Generated by generation/scientific.py. Free for any use, no attribution required — license.