Saving NumPy Arrays for ML: .npy, .npz & float32 (Why Not CSV?) | Data Toolkit for AI Ep 7
Автор: NeuraLearn AI
Загружено: 2026-10-28
Просмотров: 3
Описание:
Your data is shaped; now save it so training, testing and deployment all get exactly the same arrays. First the export checklist: confirm the shape (2 samples × 3 features → (2, 3)) and choose the dtype (float32 for model inputs, int64 for class labels). Then save losslessly: np.save() writes one array to a .npy file and np.load() gives back the same shape, dtype and values. np.savez() bundles several arrays by name into one .npz file, so you can pick data["features"] and data["labels"] when you train. Finally, why not a text/CSV file: float32 comes back as float64 (twice the memory), and a single row shaped (1, 3) comes back flat as (3,).
📱 Run this lesson's code yourself (free, offline) in the NeuraLearn AI app. It has a real Python playground, interactive lessons, quizzes and daily challenges:
👉 https://play.google.com/store/apps/de...
⏱️ Chapters
0:00 The export checklist: shape & dtype
0:34 Save one array: .npy
0:47 Save several arrays: .npz
1:01 Why not CSV? Lost dtype & shape
1:20 Recap · NumPy complete · Next: pandas
📚 Stage 2 · NumPy · Lesson 7 of the NeuraLearn AI roadmap (Data Toolkit for AI). This completes the NumPy section.
⬅️ Previous: Linear Algebra for AI (Ep 6)
➡️ Next: Pandas: DataFrames as Tables (Ep 8)
#NumPy #MachineLearning #AI #Python #DataScience
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: