天天看點

numpy中的.npy和.npz到底為何物?

A simple format for saving numpy arrays to disk with the full information about them.

The

.npy

format is the standard binary file format in NumPy for persisting a single arbitrary NumPy array on disk. The format stores all of the shape and dtype information necessary to reconstruct the array correctly even on another machine with a different architecture. The format is designed to be as simple as possible while achieving its limited goals.

The

.npz

format is the standard format for persisting multiple NumPy arrays on disk. A .npz file is a zip file containing multiple .npy files, one for each array.

繼續閱讀