Skip to content
Novus Examples
npy188 B

NumPy .npy — Boolean Mask (.npy)

A 6x10 boolean mask stored as one byte per element, because .npy does not bit-pack booleans however tempting that assumption is. The True cells follow a simple divisible-by-three rule so a mis-decode is obvious rather than plausible.

Preview — schema + first 9 rowsnpy
FieldValue
dtypebool
descr in header|b1
shape(6, 10)
fortran_orderFalse
elements60
True elements20
Storageone byte per element — .npy does not bit-pack booleans
Legal byte values0x00 and 0x01 only
Ruleelement is True where its flat index is divisible by 3
A 60-element mask occupies 60 bytes, not 8 — the classic bit-packing assumption.

Specifications

Dtype
bool
Shape
6 x 10
True Count
20
Bytes Per Element
1
Descr
|b1
Note
one byte per element, NOT a packed bit array

Testing contract

Expected to pass
Scenario
Load the mask and count the True elements, then check the size of the data section that follows the header.
Expected result
Exactly 20 of the 60 elements are True, the data section is 60 bytes long, and every data byte is 0x00 or 0x01.

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 — Boolean Mask (.npy)” is a deterministic Novus Examples fixture for Scientific data, Serialization testing. 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: NPY · 188 bytes. 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.