numpy-ts supports the same binary and text file formats as NumPy. The API is split across two entry points: numpy-ts/node for filesystem access, and numpy-ts (or numpy-ts/core) for in-memory serialization suitable for browsers.
Loading .npy files
The .npy format stores a single array with its dtype, shape, and byte order metadata.
In Node.js, you can use load and save from numpy-ts/node for convenient file I/O without manual serialization.
Working with NPZ archives (multiple arrays)
The .npz format bundles multiple named arrays into a single ZIP archive.
CSV loading with parseTxt
Load delimited text files (CSV, TSV, etc.) into arrays.
Flexible text loading with genfromtxt
genfromtxt is like parseTxt but handles missing and irregular data more gracefully.
Pull numeric data from unstructured text using regular expressions.
NumPy interoperability
Files saved by numpy-ts can be loaded by Python NumPy, and vice versa. This makes it easy to share data between TypeScript and Python workflows.
numpy-ts only supports numeric dtypes. Object arrays, structured arrays, string arrays, and pickle-based .npy files from Python cannot be loaded.