Saving and loading NumPy arrays is easy! 💾
3-Second Blueprint (English)
- np.save() serializes a single ndarray to binary .npy format, preserving multidimensional shape and dtype upon np.load().
- np.savez() bundles multiple arrays into one .npz archive, returning a dictionary-like NpzFile object indexed by array keys.
- np.savez_compressed() shrinks .npz file size for large datasets while trading off slower read and decompression throughput.
NumPyPython.npy / .npz Formatsnp.savez_compressed
3-Sekunden-Fazit (Deutsch)
- np.save() serialisiert ein einzelnes ndarray binär im .npy-Format und erhält Form sowie Datentyp beim Laden mit np.load().
- np.savez() bündelt mehrere Arrays in einem .npz-Archiv, das als schlüsselbasiertes NpzFile-Objekt ausgelesen wird.
- np.savez_compressed() reduziert die Dateigröße großer Arrays deutlich, erfordert beim Laden aber zusätzliche Dekompressionszeit.
NumPyPython.npy / .npz-Formatenp.savez_compressed
Note / Hinweis: Blueprints are AI-generated educational summaries (0% Politics · 0% Religion · 0% Brainrot) and do not constitute medical, legal, or financial advice. / KI-generierte Zusammenfassung zu Bildungszwecken – ersetzt keine medizinische, rechtliche oder finanzielle Fachberatung.