Writing¶
For writing, instantiate an mmnpz.NpzWriter.
- class mmnpz.NpzWriter(fn, mode='x')[source]¶
Helper class to sequentially add arrays to a given uncompressed .npz file.
- Parameters:
Examples
Store data sequentially on disk, possibly overwriting an existing .npz file:
>>> with mmnpz.NpzWriter("/tmp/123.npz", mode="w") as f: >>> f.write("a", [[1, 2], [3, 4]]) >>> f.write("b", [5, 6, 7, 8])
Append more data later:
>>> with mmnpz.NpzWriter("/tmp/123.npz", mode="a") as f: >>> f.write("c", [[9.5], [10.5]])
- zip¶
The ZipFile object for accessing the .npz file.
- Type:
ZipFile instance